Page 1 of 1

q3map2n + half lambert angle attenuation

Posted: Fri Feb 12, 2010 12:37 pm
by jal_
I've put together a test build of q3map2n (rev. 421) with the added switch for using Valve's half lambert curve for light angle attenuation so you can give it a try by yourselves. Quoted from the screenshots thread:
I'm giving a try to using Valve's halflambert ramp for light angle attenuation in q3map2 (for those who don't know what this is: q3map angle attenuation would be lambert attenuation, lambert is also used for lightingDiffuse in quake, HL2 uses what they call halflambert for models, I'm unaware if they use it at all in the map compiler or not. More info here and more specifically here).
The most important effect of the falloff change is that walls receive sun light better, as suns are frequently close to straight looking down, which is perpendicular to wall normals, which makes walls not receive their light since it was inhibited by the strong angle attenuation.

Test build binaries (windows only):

http://www.warsow.net/dev/jal/q3map2n-lightanglehl.zip

Code changes: here

To enable the lighting change add -lightanglehl 1 to your -light cmd line.

The lighting change can be very subtle, close to invisible depending on the map light. If you want to verify the switch was activated you can look in the build log for: "Enabling half lambert light angle attenuation".

Example shots:

Comparison (old/new):

[lvlshot]http://www.foopics.com/showfull/d955611 ... e72d7bd28e[/lvlshot]
[lvlshot]http://www.foopics.com/showfull/b86d537 ... a21c231e69[/lvlshot]

Comparison (old/new):

[lvlshot]http://www.foopics.com/showfull/7e56f7e ... 139f7379e3[/lvlshot]
[lvlshot]http://www.foopics.com/showfull/9a1ca5a ... a7107ba60b[/lvlshot]

Re: q3map2n + half lambert angle attenuation

Posted: Fri Feb 12, 2010 8:31 pm
by sock
I am glad you have split this off into a seperate thread, it will get buried in the screenshot thread. I did not realise your first screenshots were lightmap only, probably explains why they were so bright white and giving me a suntan. The second set certainly show off the idea alot better as I can clearly see the sunlight going down the wall and connecting to the floor highlight properly. Looks very cool :)

I was curious to see what this would look like in my current map project, so I downloaded your new q3map2 exe and tried to compile my map. I got this error:

Code: Select all

************ ERROR ************
safe_malloc failed on allocation of 330301440 bytes
So I tried to compile a small section of the map and all the shaders were broken. I imagine I am missing some paths or something but I cannot see any clues in the log file. I can compile the map fine with the previous q3map2. I will have to experiment a bit more with setup.

Can you post an example compile setup? what settings do you normally use?

Re: q3map2n + half lambert angle attenuation

Posted: Fri Feb 12, 2010 9:10 pm
by jal_
Hmm... that's coming from the differences between q3map2 and q3map2n. Probably a memory bug in q3map2n. I guess I could compile a stock q3map2 with this change too.

The settings I used (keep in mind this is for Warsow, it's slightly different, and the -lightanglehl is enabled by default in that case):

Generic ones
-game qfusion -fs_basepath [EnginePath] -fs_game [GameName]
etc
-meta -samplesize 8 -mv 65000 -mi 65000
-vis -saveprt
-light -deluxe -patchshadows -v -fast -fastgrid -samplesize 8 -samples 4 -bounce 3 -fastbounce -bouncegrid -bouncescale 2.25 -dirty -dirtdepth 72 -dirtgain 1.75 -nolightmapsearch

(I know the bounce settings are a bit weird, but I don't feel like waiting forever)

Are you using -lomem? I suspect -lomem is broken in q3map2n.

Re: q3map2n + half lambert angle attenuation

Posted: Fri Feb 12, 2010 9:48 pm
by jal_
Try with this one. It isn't exactly q3map2 2.5.17, but has very little changes from it. Some fixes to the models clipping and the light thing. Should do it well where q3map2 was doing well.

http://www.warsow.net/dev/jal/q3map2_2. ... nglehl.zip

EDIT: I patched the light changes into some old source I had in the HD. I didn't even test a single build, but it should be fine. :paranoid:

Re: q3map2n + half lambert angle attenuation

Posted: Fri Feb 12, 2010 10:24 pm
by Delirium
jal_ wrote:-mv 65000 -mi 65000
what does this do?

Re: q3map2n + half lambert angle attenuation

Posted: Fri Feb 12, 2010 10:41 pm
by jal_
Sets a higher limit for max vertices per surface and max indexes per surface.

Re: q3map2n + half lambert angle attenuation

Posted: Fri Feb 12, 2010 10:53 pm
by Silicone_Milk
that's hot.