0
0
Fork 0
mirror of https://github.com/ZDoom/gzdoom.git synced 2025-03-10 11:21:53 +00:00
gzdoom/wadsrc/static/shaders/scene/light_spot.glsl
2023-09-25 21:18:57 +02:00

7 lines
290 B
GLSL

float spotLightAttenuation(vec4 lightpos, vec3 spotdir, float lightCosInnerAngle, float lightCosOuterAngle)
{
vec3 lightDirection = normalize(lightpos.xyz - pixelpos.xyz);
float cosDir = dot(lightDirection, spotdir);
return smoothstep(lightCosOuterAngle, lightCosInnerAngle, cosDir);
}