gzdoom/wadsrc/static/shaders/scene/light_spot.glsl

8 lines
290 B
Text
Raw Normal View History

2023-03-19 06:18:12 +00:00
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);
}