mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- Significantly improve shadowmap light performance for faces with a large number of lights but where only a few applies to each individual fragment
This commit is contained in:
parent
33beca6e6f
commit
5c7b1ee8e1
1 changed files with 1 additions and 0 deletions
|
@ -220,6 +220,7 @@ float diffuseContribution(vec3 lightDirection, vec3 normal)
|
|||
float pointLightAttenuation(vec4 lightpos, float lightcolorA)
|
||||
{
|
||||
float attenuation = max(lightpos.w - distance(pixelpos.xyz, lightpos.xyz),0.0) / lightpos.w;
|
||||
if (attenuation == 0.0) return 0.0;
|
||||
#ifdef SUPPORTS_SHADOWMAPS
|
||||
float shadowIndex = abs(lightcolorA) - 1.0;
|
||||
attenuation *= shadowmapAttenuation(lightpos, shadowIndex);
|
||||
|
|
Loading…
Reference in a new issue