diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/spotLightP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/spotLightP.glsl index f96212c8d..0c423630e 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/spotLightP.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/spotLightP.glsl @@ -165,7 +165,7 @@ void main() // Lookup the cookie sample.d float cosTheta = dot(-surfaceToLight.L, lightDirection); float angle = acos(cosTheta) * ( M_1OVER_PI_F); - float iesMask = texture(iesProfile, angle).r; + float iesMask = texture(iesProfile, angle/(lightSpotParams.x-lightSpotParams.y)).r; // Multiply the light with the iesMask tex. shadow *= iesMask; #endif diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl index dc47ea23d..c2d8d1e9e 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl @@ -163,7 +163,7 @@ float4 main( ConvexConnectP IN ) : SV_TARGET // Lookup the cookie sample.d float cosTheta = dot(-surfaceToLight.L, lightDirection); float angle = acos(cosTheta) * ( M_1OVER_PI_F); - float iesMask = TORQUE_TEX1D(iesProfile, angle).r; + float iesMask = TORQUE_TEX1D(iesProfile, angle/(lightSpotParams.x-lightSpotParams.y)).r; // Multiply the light with the iesMask tex. shadow *= iesMask; #endif