mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-31 04:20:34 +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
|
@ -9,10 +9,6 @@ vec3 lightContribution(int i, vec3 normal)
|
|||
float lightdistance = distance(lightpos.xyz, pixelpos.xyz);
|
||||
if (lightpos.w < lightdistance)
|
||||
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);
|
||||
|
||||
|
@ -21,7 +17,8 @@ vec3 lightContribution(int i, vec3 normal)
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue