mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-07 15:31:02 +00:00
Revert "- check light direction in the shader."
This reverts commit e9f7383279
.
It was not needed in the old version.
This commit is contained in:
parent
15b28aadd9
commit
1b7312c0d0
1 changed files with 2 additions and 5 deletions
|
@ -10,10 +10,6 @@ vec3 lightContribution(int i, vec3 normal)
|
||||||
if (lightpos.w < lightdistance)
|
if (lightpos.w < lightdistance)
|
||||||
return vec3(0.0); // Early out lights touching surface but not this fragment
|
return vec3(0.0); // Early out lights touching surface but not this fragment
|
||||||
|
|
||||||
vec3 lightdir = normalize(lightpos.xyz - pixelpos.xyz);
|
|
||||||
float dotprod = dot(normal, lightdir);
|
|
||||||
if (dotprod < -0.0001) return vec3(0.0); // light hits from the backside. This can happen with full sector light lists and must be rejected for all cases. Note that this can cause precision issues.
|
|
||||||
|
|
||||||
float attenuation = clamp((lightpos.w - lightdistance) / lightpos.w, 0.0, 1.0);
|
float attenuation = clamp((lightpos.w - lightdistance) / lightpos.w, 0.0, 1.0);
|
||||||
|
|
||||||
if (lightspot1.w == 1.0)
|
if (lightspot1.w == 1.0)
|
||||||
|
@ -21,7 +17,8 @@ vec3 lightContribution(int i, vec3 normal)
|
||||||
|
|
||||||
if (lightcolor.a < 0.0) // Sign bit is the attenuated light flag
|
if (lightcolor.a < 0.0) // Sign bit is the attenuated light flag
|
||||||
{
|
{
|
||||||
attenuation *= clamp(dotprod, 0.0, 1.0);
|
vec3 lightdir = normalize(lightpos.xyz - pixelpos.xyz);
|
||||||
|
attenuation *= clamp(dot(normal, lightdir), 0.0, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attenuation > 0.0) // Skip shadow map test if possible
|
if (attenuation > 0.0) // Skip shadow map test if possible
|
||||||
|
|
Loading…
Reference in a new issue