Browse Source

allow spotlights specifically to comprress ies based on angle differentials

AzaezelX 1 year ago
parent
commit
c27b9bf48f

+ 1 - 1
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

+ 1 - 1
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