mkultra
9 постов
Карма: 2
#1 17 декабря 2008 в 15:55
I&#39;ve made a few minor modifications to the bers@q2 code, and since it is almost the new year and I&#39;ll be busy I thought I&#39;d post them.&nbsp; They might be useful to some, plus it contains the stereoscopic fix for the other thread.<br /><br />The code modifications are all tagged &quot;Jared&quot;, my other name, so they are easy to find with a search.<br /><br />I&#39;ve added the following cvars.<br /><br />r_flashlight_x<br />r_flashlight_y<br />r_flashlight_z<br />scr_lightinfo<br />r_cutlight_radius<br />r_stereoscopic_fix<br /><br />r_flashlight_x, y, z can be used to reposition the flashlight.&nbsp; I find the standard position on Doom3, Quake4 and Berserker@q2 doesn&#39;t highlight the shadows as well as it should.&nbsp; For a better and more dramatic effect, the flashlight needs to be a little off centre. <br /><br />I use<br /><br />r_flashlight_x 6<br />r_flashlight_y -12<br />r_flashlight_z 0<br /><br />for stronger and more dramatic shadows.&nbsp; It creates the impression that the flashlight is positioned just under your gun barrel.<br /><br />scr_lightinfo is similar to scr_fps.&nbsp; It prints info about the lights on the map.&nbsp; First number it prints is how many static lights, second is how many dynamic lights, and third is how many visible lights.<br /><br />On my system some maps started to go a bit slow due to too many lights, especially small lights close together.&nbsp; This happened in some of the later palace maps.&nbsp; So I added r_cutlight_radius.&nbsp; On a map load this gets rid of lights that are closer than a certain radius defined by the user.&nbsp; This results in a darker map, but not significantly, and with the flashlight it doesn&#39;t matter much, in fact it looks quite good.&nbsp; I use r_cutlight_radius 128.&nbsp; Use with scr_lightinfo to find the best compromise.<br /><br />And last of all I&#39;ve added the r_stereoscopic_fix that gets rid of the visual glitches that appeared in stereoscopic mode on older nvidia cards (pre-8000 cards).<br /><br />Also I&#39;ve included a textfile readme for stereoscopic users about how to best set up Berserker@q2 to run in stereoscopic mode.<br /><br />One last change I wanted to make but didn&#39;t get around to was that the flashlight doesn&#39;t seem to remember that it was on when you move from map to map.&nbsp; It always defaults back to off.&nbsp; I don&#39;t know the q2 code well enough at the moment to find where to alter that.<br /><br />I&#39;ve uploaded the source code here:http://www.speedyshare.com/928899309.html<br />
Берсеркер
2326 постов
Карма: 217
#2 18 декабря 2008 в 14:35
Rus:<br />Мои комментарии:<br />1. Все изменения в сурсах помечены как&nbsp; JARED.<br />2. Используйте r_cutlight_radius для не-релайтенных карт. Нет смысла использовать для таких карт, как base1 или q2dm1. Лучше переосветить карты, эффект будет гораздо круче.&nbsp; 8)<br /><br />Eng:<br />My comments:<br />1. All mkultra&#39;s code changes labeled as JARED.<br />2. Use r_cutlight_radius for non-relighted maps (on base1 or q2dm1 do not have effect).<br />Please, re-light all maps!&nbsp; &nbsp;::)<br />
Машина несла меня через неведомые районы Галактики сквозь пространство математической реальности быстрее скорости света. (C) Фред Саберхаген.
Берсеркер
2326 постов
Карма: 217
#3 18 декабря 2008 в 15:13
mkultra<br />I&#39;ll add your code changes to next release.
Машина несла меня через неведомые районы Галактики сквозь пространство математической реальности быстрее скорости света. (C) Фред Саберхаген.
mkultra
9 постов
Карма: 2
#4 18 декабря 2008 в 15:14
Thanks Berserker.<br /><br />I noticed I made an error in the readme.&nbsp; Where it says<br /><br />&quot;If you get black, squarish glitches then set r_stereoscopic_fix 0.&quot;<br /><br />it should say<br /><br />&quot;If you get black, squarish glitches then set r_stereoscopic_fix 1.&quot;<br /><br />I also noticed in the code that I set the default value for scr_lightinfo to 1, it should really be 0 since it isn&#39;t needed except for testing or mapping.
KRIGSSVIN
930 постов
Карма: 53
#5 18 декабря 2008 в 16:16
mkultra, I like your efforts to make smth better ;D This is such a rare thing...&nbsp; &gt;:(
willow
570 постов
Карма: 56
#6 18 декабря 2008 в 17:33
RE: r_cutlight_radius<br />IMO<br />Makes no sense to me. Looks like a dirty hack over dirty hacked lighting itself which is made as rough base for something random. It cannot possibly by the use of cut automagic turn the lights accident mess into what the one can call the &quot;relight&quot; thing.<br />
mkultra
9 постов
Карма: 2
#7 19 декабря 2008 в 00:01
Makes no sense to me. Looks like a dirty hack over dirty hacked lighting itself which is made as rough base for something random. It cannot possibly by the use of cut automagic turn the lights accident mess into what the one can call the &quot;relight&quot; thing.
<br /><br />It isn&#39;t the best solution, a dirty hack indeed.&nbsp; Can make the lighting look a bit uneven.&nbsp; But for me it was better than running at 15 fps in the Palace.&nbsp; (I think it was the palace, can&#39;t recall exactly). <br /><br />It seemed to work for me.&nbsp; On load, for every light it goes to add it first checks against all other lights.&nbsp; If this light is close to another light and dimmer, it doesn&#39;t get added.&nbsp; If this light is close to another light and brighter, it overwrites the other light.&nbsp; And if it isn&#39;t close to any other lights, it just gets added normally.&nbsp;