mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 20:15:33 +00:00
Clamp individual light attenuation at 1
This commit is contained in:
parent
7ad1e962e0
commit
a39c129954
1 changed files with 2 additions and 2 deletions
|
@ -146,11 +146,11 @@
|
|||
|
||||
#if VERTEXCOLOR_MODE == 2
|
||||
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);
|
||||
#else
|
||||
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);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue