mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 23:33:00 +00:00
8 lines
290 B
Text
8 lines
290 B
Text
|
|
||
|
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);
|
||
|
}
|