Przeglądaj źródła

Merge pull request #723 from Azaezel/lightRay_Cleanup

Light ray cleanup
Areloch 11 lat temu
rodzic
commit
099a91553a

+ 1 - 1
Templates/Empty/game/shaders/common/postFx/lightRay/lightRayOccludeP.hlsl

@@ -45,7 +45,7 @@ float4 main( PFXVertToPix IN ) : COLOR0
         col = tex2D( backBuffer, IN.uv0 );
 
         //col = 1 - exp(-120000 * col);
-        col += dot( col, LUMINANCE_VECTOR ) + 0.0001f;
+        col += dot( col.rgb, LUMINANCE_VECTOR ) + 0.0001f;
         col *= brightScalar;
     }
     

+ 3 - 3
Templates/Empty/game/shaders/common/postFx/lightRay/lightRayP.hlsl

@@ -59,7 +59,7 @@ float4 main( PFXVertToPix IN ) : COLOR0
     half2 deltaTexCoord = (half2)( texCoord.xy - screenSunPos );  
 
     // Divide by number of samples and scale by control factor.  
-    deltaTexCoord *= 1.0 / (half)samples * density; 
+    deltaTexCoord *= (half)(1.0 / samples * density); 
 	
     // Evaluate summation from Equation 3 NUM_SAMPLES iterations.  
     for ( int i = 0; i < samples; i++ )  
@@ -71,13 +71,13 @@ float4 main( PFXVertToPix IN ) : COLOR0
         half3 sample = (half3)tex2Dlod( frameSampler, texCoord );  
 
         // Apply sample attenuation scale/decay factors.
-        sample *= illuminationDecay * weight;
+        sample *= half(illuminationDecay * weight);
 
         // Accumulate combined color.
         color += sample;
 
         // Update exponential decay factor.
-        illuminationDecay *= decay;
+        illuminationDecay *= half(decay);
     }       
    
     //return saturate( amount ) * color * Exposure;

+ 1 - 1
Templates/Full/game/shaders/common/postFx/lightRay/lightRayOccludeP.hlsl

@@ -45,7 +45,7 @@ float4 main( PFXVertToPix IN ) : COLOR0
         col = tex2D( backBuffer, IN.uv0 );
 
         //col = 1 - exp(-120000 * col);
-        col += dot( col, LUMINANCE_VECTOR ) + 0.0001f;
+        col += dot( col.rgb, LUMINANCE_VECTOR ) + 0.0001f;
         col *= brightScalar;
     }
     

+ 3 - 3
Templates/Full/game/shaders/common/postFx/lightRay/lightRayP.hlsl

@@ -59,7 +59,7 @@ float4 main( PFXVertToPix IN ) : COLOR0
     half2 deltaTexCoord = (half2)( texCoord.xy - screenSunPos );  
 
     // Divide by number of samples and scale by control factor.  
-    deltaTexCoord *= 1.0 / (half)samples * density; 
+    deltaTexCoord *= (half)(1.0 / samples * density); 
 	
     // Evaluate summation from Equation 3 NUM_SAMPLES iterations.  
     for ( int i = 0; i < samples; i++ )  
@@ -71,13 +71,13 @@ float4 main( PFXVertToPix IN ) : COLOR0
         half3 sample = (half3)tex2Dlod( frameSampler, texCoord );  
 
         // Apply sample attenuation scale/decay factors.
-        sample *= illuminationDecay * weight;
+        sample *= half(illuminationDecay * weight);
 
         // Accumulate combined color.
         color += sample;
 
         // Update exponential decay factor.
-        illuminationDecay *= decay;
+        illuminationDecay *= half(decay);
     }       
    
     //return saturate( amount ) * color * Exposure;