1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:53:51 +00:00

Clamp individual light attenuation at 1

This commit is contained in:
scrawl 2013-03-29 19:53:52 +01:00
parent 7ad1e962e0
commit a39c129954

View file

@ -146,11 +146,11 @@
#if VERTEXCOLOR_MODE == 2 #if VERTEXCOLOR_MODE == 2
lightResult.xyz += colour.xyz * lightDiffuse[@shIterator].xyz lightResult.xyz += colour.xyz * lightDiffuse[@shIterator].xyz
* (1.0 / ((lightAttenuation[@shIterator].y) + (lightAttenuation[@shIterator].z * d) + (lightAttenuation[@shIterator].w * d * d))) * shSaturate(1.0 / ((lightAttenuation[@shIterator].y) + (lightAttenuation[@shIterator].z * d) + (lightAttenuation[@shIterator].w * d * d)))
* max(dot(viewNormal.xyz, lightDir), 0); * max(dot(viewNormal.xyz, lightDir), 0);
#else #else
lightResult.xyz += materialDiffuse.xyz * lightDiffuse[@shIterator].xyz lightResult.xyz += materialDiffuse.xyz * lightDiffuse[@shIterator].xyz
* (1.0 / ((lightAttenuation[@shIterator].y) + (lightAttenuation[@shIterator].z * d) + (lightAttenuation[@shIterator].w * d * d))) * shSaturate(1.0 / ((lightAttenuation[@shIterator].y) + (lightAttenuation[@shIterator].z * d) + (lightAttenuation[@shIterator].w * d * d)))
* max(dot(viewNormal.xyz, lightDir), 0); * max(dot(viewNormal.xyz, lightDir), 0);
#endif #endif