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:
parent
7ad1e962e0
commit
a39c129954
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue