Browse Source

Clean GLSL fragment shader out.

LuisAntonRebollo 10 years ago
parent
commit
ed0febea39
100 changed files with 331 additions and 182 deletions
  1. 1 1
      Engine/source/shaderGen/GLSL/shaderGenGLSL.cpp
  2. 2 2
      Templates/Empty/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl
  3. 2 2
      Templates/Empty/game/shaders/common/fixedFunction/gl/colorP.glsl
  4. 2 2
      Templates/Empty/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl
  5. 2 2
      Templates/Empty/game/shaders/common/fixedFunction/gl/textureP.glsl
  6. 3 1
      Templates/Empty/game/shaders/common/gl/basicCloudsP.glsl
  7. 6 4
      Templates/Empty/game/shaders/common/gl/blurP.glsl
  8. 3 1
      Templates/Empty/game/shaders/common/gl/cloudLayerP.glsl
  9. 4 2
      Templates/Empty/game/shaders/common/gl/fxFoliageReplicatorP.glsl
  10. 0 3
      Templates/Empty/game/shaders/common/gl/hlslCompat.glsl
  11. 2 1
      Templates/Empty/game/shaders/common/gl/particleCompositeP.glsl
  12. 4 2
      Templates/Empty/game/shaders/common/gl/particlesP.glsl
  13. 3 1
      Templates/Empty/game/shaders/common/gl/planarReflectBumpP.glsl
  14. 3 1
      Templates/Empty/game/shaders/common/gl/planarReflectP.glsl
  15. 3 1
      Templates/Empty/game/shaders/common/gl/precipP.glsl
  16. 2 2
      Templates/Empty/game/shaders/common/gl/projectedShadowP.glsl
  17. 5 3
      Templates/Empty/game/shaders/common/gl/scatterSkyP.glsl
  18. 1 1
      Templates/Empty/game/shaders/common/gl/torque.glsl
  19. 4 2
      Templates/Empty/game/shaders/common/gl/wavesP.glsl
  20. 3 1
      Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl
  21. 3 1
      Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl
  22. 3 1
      Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl
  23. 3 1
      Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl
  24. 3 1
      Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl
  25. 2 1
      Templates/Empty/game/shaders/common/lighting/advanced/gl/pointLightP.glsl
  26. 3 1
      Templates/Empty/game/shaders/common/lighting/advanced/gl/spotLightP.glsl
  27. 3 1
      Templates/Empty/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl
  28. 5 5
      Templates/Empty/game/shaders/common/lighting/basic/gl/shadowFilterP.glsl
  29. 3 1
      Templates/Empty/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl
  30. 5 3
      Templates/Empty/game/shaders/common/postFx/caustics/gl/causticsP.glsl
  31. 7 5
      Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl
  32. 6 4
      Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl
  33. 3 1
      Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_Final_P.glsl
  34. 11 11
      Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_Gausian_P.glsl
  35. 3 1
      Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_SmallBlur_P.glsl
  36. 3 1
      Templates/Empty/game/shaders/common/postFx/edgeaa/gl/dbgEdgeDisplayP.glsl
  37. 3 1
      Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeAAP.glsl
  38. 3 1
      Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeDetectP.glsl
  39. 3 1
      Templates/Empty/game/shaders/common/postFx/fxaa/gl/fxaaP.glsl
  40. 3 1
      Templates/Empty/game/shaders/common/postFx/gl/chromaticLens.glsl
  41. 3 1
      Templates/Empty/game/shaders/common/postFx/gl/flashP.glsl
  42. 3 1
      Templates/Empty/game/shaders/common/postFx/gl/fogP.glsl
  43. 3 1
      Templates/Empty/game/shaders/common/postFx/gl/gammaP.glsl
  44. 15 14
      Templates/Empty/game/shaders/common/postFx/gl/glowBlurP.glsl
  45. 3 1
      Templates/Empty/game/shaders/common/postFx/gl/motionBlurP.glsl
  46. 3 1
      Templates/Empty/game/shaders/common/postFx/gl/passthruP.glsl
  47. 3 1
      Templates/Empty/game/shaders/common/postFx/gl/turbulenceP.glsl
  48. 3 1
      Templates/Empty/game/shaders/common/postFx/gl/underwaterFogP.glsl
  49. 3 1
      Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurHP.glsl
  50. 3 1
      Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurVP.glsl
  51. 3 1
      Templates/Empty/game/shaders/common/postFx/hdr/gl/brightPassFilterP.glsl
  52. 3 1
      Templates/Empty/game/shaders/common/postFx/hdr/gl/calculateAdaptedLumP.glsl
  53. 3 1
      Templates/Empty/game/shaders/common/postFx/hdr/gl/downScale4x4P.glsl
  54. 3 1
      Templates/Empty/game/shaders/common/postFx/hdr/gl/finalPassCombineP.glsl
  55. 3 1
      Templates/Empty/game/shaders/common/postFx/hdr/gl/luminanceVisP.glsl
  56. 3 1
      Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumInitialP.glsl
  57. 2 1
      Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumIterativeP.glsl
  58. 2 1
      Templates/Empty/game/shaders/common/postFx/lightRay/gl/lightRayOccludeP.glsl
  59. 4 2
      Templates/Empty/game/shaders/common/postFx/lightRay/gl/lightRayP.glsl
  60. 3 1
      Templates/Empty/game/shaders/common/postFx/mlaa/gl/blendWeightCalculationP.glsl
  61. 3 1
      Templates/Empty/game/shaders/common/postFx/mlaa/gl/edgeDetectionP.glsl
  62. 2 1
      Templates/Empty/game/shaders/common/postFx/mlaa/gl/neighborhoodBlendingP.glsl
  63. 2 1
      Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_Blur_P.glsl
  64. 4 2
      Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_P.glsl
  65. 3 1
      Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_PowerTable_P.glsl
  66. 3 1
      Templates/Empty/game/shaders/common/terrain/gl/blendP.glsl
  67. 4 2
      Templates/Empty/game/shaders/common/water/gl/waterBasicP.glsl
  68. 3 1
      Templates/Empty/game/shaders/common/water/gl/waterP.glsl
  69. 2 2
      Templates/Full/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl
  70. 2 2
      Templates/Full/game/shaders/common/fixedFunction/gl/colorP.glsl
  71. 2 2
      Templates/Full/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl
  72. 2 2
      Templates/Full/game/shaders/common/fixedFunction/gl/textureP.glsl
  73. 3 1
      Templates/Full/game/shaders/common/gl/basicCloudsP.glsl
  74. 6 4
      Templates/Full/game/shaders/common/gl/blurP.glsl
  75. 3 1
      Templates/Full/game/shaders/common/gl/cloudLayerP.glsl
  76. 4 2
      Templates/Full/game/shaders/common/gl/fxFoliageReplicatorP.glsl
  77. 0 3
      Templates/Full/game/shaders/common/gl/hlslCompat.glsl
  78. 2 1
      Templates/Full/game/shaders/common/gl/particleCompositeP.glsl
  79. 4 2
      Templates/Full/game/shaders/common/gl/particlesP.glsl
  80. 3 1
      Templates/Full/game/shaders/common/gl/planarReflectBumpP.glsl
  81. 3 1
      Templates/Full/game/shaders/common/gl/planarReflectP.glsl
  82. 3 1
      Templates/Full/game/shaders/common/gl/precipP.glsl
  83. 2 2
      Templates/Full/game/shaders/common/gl/projectedShadowP.glsl
  84. 5 3
      Templates/Full/game/shaders/common/gl/scatterSkyP.glsl
  85. 1 1
      Templates/Full/game/shaders/common/gl/torque.glsl
  86. 4 2
      Templates/Full/game/shaders/common/gl/wavesP.glsl
  87. 3 1
      Templates/Full/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl
  88. 3 1
      Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl
  89. 3 1
      Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl
  90. 3 1
      Templates/Full/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl
  91. 3 1
      Templates/Full/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl
  92. 3 2
      Templates/Full/game/shaders/common/lighting/advanced/gl/pointLightP.glsl
  93. 3 1
      Templates/Full/game/shaders/common/lighting/advanced/gl/spotLightP.glsl
  94. 3 1
      Templates/Full/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl
  95. 5 5
      Templates/Full/game/shaders/common/lighting/basic/gl/shadowFilterP.glsl
  96. 3 1
      Templates/Full/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl
  97. 5 3
      Templates/Full/game/shaders/common/postFx/caustics/gl/causticsP.glsl
  98. 6 4
      Templates/Full/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl
  99. 6 4
      Templates/Full/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl
  100. 3 1
      Templates/Full/game/shaders/common/postFx/dof/gl/DOF_Final_P.glsl

+ 1 - 1
Engine/source/shaderGen/GLSL/shaderGenGLSL.cpp

@@ -75,7 +75,7 @@ void ShaderGenPrinterGLSL::printPixelShaderOutputStruct( Stream& stream, const M
     }
     }
 
 
     WRITESTR(avar("//Fragment shader OUT\r\n"));
     WRITESTR(avar("//Fragment shader OUT\r\n"));
-    //WRITESTR(avar("out vec4 OUT_col;\r\n", i)); // @todo OUT_col defined on hlslCompat.glsl
+    WRITESTR(avar("out vec4 OUT_col;\r\n"));
     for( U32 i = 1; i < 4; i++ )
     for( U32 i = 1; i < 4; i++ )
     {
     {
         if( numMRTs & 1 << i )
         if( numMRTs & 1 << i )

+ 2 - 2
Templates/Empty/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl

@@ -24,9 +24,9 @@ uniform sampler2D diffuseMap;
 in vec4 color;
 in vec4 color;
 in vec2 texCoord;
 in vec2 texCoord;
 
 
-out vec4 OUT_FragColor0;
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = vec4(color.rgb, color.a * texture(diffuseMap, texCoord).a);
+   OUT_col = vec4(color.rgb, color.a * texture(diffuseMap, texCoord).a);
 }
 }

+ 2 - 2
Templates/Empty/game/shaders/common/fixedFunction/gl/colorP.glsl

@@ -22,9 +22,9 @@
 
 
 in vec4 color;
 in vec4 color;
 
 
-out vec4 OUT_FragColor0;
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = color;
+   OUT_col = color;
 }
 }

+ 2 - 2
Templates/Empty/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl

@@ -24,9 +24,9 @@ uniform sampler2D diffuseMap;
 in vec4 color;
 in vec4 color;
 in vec2 texCoord;
 in vec2 texCoord;
 
 
-out vec4 OUT_FragColor0;
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = texture(diffuseMap, texCoord) * color;
+   OUT_col = texture(diffuseMap, texCoord) * color;
 }
 }

+ 2 - 2
Templates/Empty/game/shaders/common/fixedFunction/gl/textureP.glsl

@@ -23,9 +23,9 @@
 uniform sampler2D diffuseMap;
 uniform sampler2D diffuseMap;
 in vec2 texCoord;
 in vec2 texCoord;
 
 
-out vec4 OUT_FragColor0;
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = texture(diffuseMap, texCoord);
+   OUT_col = texture(diffuseMap, texCoord);
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/gl/basicCloudsP.glsl

@@ -30,8 +30,10 @@ in vec2 texCoord;
 
 
 uniform sampler2D diffuseMap        ;
 uniform sampler2D diffuseMap        ;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    vec4 col = texture( diffuseMap, IN_texCoord );
    vec4 col = texture( diffuseMap, IN_texCoord );
-   OUT_FragColor0 = hdrEncode( col );
+   OUT_col = hdrEncode( col );
 }
 }

+ 6 - 4
Templates/Empty/game/shaders/common/gl/blurP.glsl

@@ -28,10 +28,12 @@ uniform sampler2D diffuseMap;
 
 
 in vec2 texc0, texc1, texc2, texc3;
 in vec2 texc0, texc1, texc2, texc3;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = texture(diffuseMap, texc0) * kernel.x;
-   OUT_FragColor0 += texture(diffuseMap, texc1) * kernel.y;
-   OUT_FragColor0 += texture(diffuseMap, texc2) * kernel.z;
-   OUT_FragColor0 += texture(diffuseMap, texc3) * kernel.w;
+   OUT_col = texture(diffuseMap, texc0) * kernel.x;
+   OUT_col += texture(diffuseMap, texc1) * kernel.y;
+   OUT_col += texture(diffuseMap, texc2) * kernel.z;
+   OUT_col += texture(diffuseMap, texc3) * kernel.w;
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/gl/cloudLayerP.glsl

@@ -47,6 +47,8 @@ uniform float     cloudCoverage;
 uniform vec3      cloudBaseColor;
 uniform vec3      cloudBaseColor;
 uniform float	  cloudExposure;
 uniform float	  cloudExposure;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Globals                                                                        
 // Globals                                                                        
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -141,5 +143,5 @@ void main()
 
 
    cResultColor.a = mix( cResultColor.a, 0.0, 1.0 - pow(IN_worldDist,2.0) );
    cResultColor.a = mix( cResultColor.a, 0.0, 1.0 - pow(IN_worldDist,2.0) );
 
 
-   OUT_FragColor0 = cResultColor;
+   OUT_col = cResultColor;
 }   
 }   

+ 4 - 2
Templates/Empty/game/shaders/common/gl/fxFoliageReplicatorP.glsl

@@ -29,12 +29,14 @@ uniform vec4 groundAlpha;
 in vec4 color, groundAlphaCoeff;
 in vec4 color, groundAlphaCoeff;
 in vec2 outTexCoord, alphaLookup;
 in vec2 outTexCoord, alphaLookup;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Main                                                                        
 // Main                                                                        
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 void main()
 void main()
 {
 {
    vec4 alpha = texture(alphaMap, alphaLookup);
    vec4 alpha = texture(alphaMap, alphaLookup);
-   OUT_FragColor0 = color * texture(diffuseMap, outTexCoord);
-   OUT_FragColor0.a = OUT_FragColor0.a * min(alpha, groundAlpha + groundAlphaCoeff.x).x;
+   OUT_col = color * texture(diffuseMap, outTexCoord);
+   OUT_col.a = OUT_col.a * min(alpha, groundAlpha + groundAlphaCoeff.x).x;
 }
 }

+ 0 - 3
Templates/Empty/game/shaders/common/gl/hlslCompat.glsl

@@ -100,7 +100,4 @@ mat4 mat4FromRow( float r0c0, float r0c1, float r0c2, float r0c3,
 
 
 #ifdef TORQUE_PIXEL_SHADER
 #ifdef TORQUE_PIXEL_SHADER
 	void clip(float a) { if(a < 0) discard;}
 	void clip(float a) { if(a < 0) discard;}
-    
-   out vec4 OUT_col;
-   #define OUT_FragColor0 OUT_col
 #endif
 #endif

+ 2 - 1
Templates/Empty/game/shaders/common/gl/particleCompositeP.glsl

@@ -38,6 +38,7 @@ uniform sampler2D edgeSource;
 uniform vec4 edgeTargetParams;
 uniform vec4 edgeTargetParams;
 #endif
 #endif
 
 
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {  
 {  
@@ -57,5 +58,5 @@ void main()
 #endif
 #endif
 	
 	
 	// Sample offscreen target and return
 	// Sample offscreen target and return
-   OUT_FragColor0 = texture( colorSource, uvScene.xy );
+   OUT_col = texture( colorSource, uvScene.xy );
 }
 }

+ 4 - 2
Templates/Empty/game/shaders/common/gl/particlesP.glsl

@@ -78,6 +78,8 @@ vec4 lmSample( vec3 nrm )
 uniform float alphaFactor;
 uniform float alphaFactor;
 uniform float alphaScale;
 uniform float alphaScale;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    float softBlend = 1;
    float softBlend = 1;
@@ -100,12 +102,12 @@ void main()
 	   
 	   
    vec4 diffuse = texture( diffuseMap, IN_uv0 );
    vec4 diffuse = texture( diffuseMap, IN_uv0 );
    
    
-   //OUT_FragColor0 = vec4( lmSample(vec3(0, 0, -1)).rgb, IN_color.a * diffuse.a * softBlend * alphaScale);
+   //OUT_col = vec4( lmSample(vec3(0, 0, -1)).rgb, IN_color.a * diffuse.a * softBlend * alphaScale);
    
    
    // Scale output color by the alpha factor (turn LerpAlpha into pre-multiplied alpha)
    // Scale output color by the alpha factor (turn LerpAlpha into pre-multiplied alpha)
    vec3 colorScale = ( alphaFactor < 0.0 ? IN_color.rgb * diffuse.rgb : vec3( alphaFactor > 0.0 ? IN_color.a * diffuse.a * alphaFactor * softBlend : softBlend ) );
    vec3 colorScale = ( alphaFactor < 0.0 ? IN_color.rgb * diffuse.rgb : vec3( alphaFactor > 0.0 ? IN_color.a * diffuse.a * alphaFactor * softBlend : softBlend ) );
    
    
-   OUT_FragColor0 = hdrEncode( vec4( IN_color.rgb * diffuse.rgb * colorScale,
+   OUT_col = hdrEncode( vec4( IN_color.rgb * diffuse.rgb * colorScale,
                   IN_color.a * diffuse.a * softBlend * alphaScale ) );
                   IN_color.a * diffuse.a * softBlend * alphaScale ) );
 }
 }
 
 

+ 3 - 1
Templates/Empty/game/shaders/common/gl/planarReflectBumpP.glsl

@@ -29,6 +29,8 @@ uniform vec4 shadeColor;
 in vec2 TEX0;
 in vec2 TEX0;
 in vec4 TEX1;
 in vec4 TEX1;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Fade edges of axis for texcoord passed in
 // Fade edges of axis for texcoord passed in
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -64,5 +66,5 @@ void main()
    vec4 diffuseColor = texture( diffuseMap, TEX0 );
    vec4 diffuseColor = texture( diffuseMap, TEX0 );
    vec4 reflectColor = textureProj( refractMap, texIndex );
    vec4 reflectColor = textureProj( refractMap, texIndex );
 
 
-   OUT_FragColor0 = diffuseColor + reflectColor * diffuseColor.a;
+   OUT_col = diffuseColor + reflectColor * diffuseColor.a;
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/gl/planarReflectP.glsl

@@ -29,6 +29,8 @@ uniform vec4 shadeColor;
 in vec2 TEX0;
 in vec2 TEX0;
 in vec4 TEX1;
 in vec4 TEX1;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Main                                                                        
 // Main                                                                        
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -37,5 +39,5 @@ void main()
    vec4 diffuseColor = texture( diffuseMap, TEX0 );
    vec4 diffuseColor = texture( diffuseMap, TEX0 );
    vec4 reflectColor = textureProj( refractMap, TEX1 );
    vec4 reflectColor = textureProj( refractMap, TEX1 );
 
 
-   OUT_FragColor0 = diffuseColor + reflectColor * diffuseColor.a;
+   OUT_col = diffuseColor + reflectColor * diffuseColor.a;
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/gl/precipP.glsl

@@ -28,10 +28,12 @@ uniform sampler2D diffuseMap;
 in vec4 color;
 in vec4 color;
 in vec2 texCoord;
 in vec2 texCoord;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Main                                                                        
 // Main                                                                        
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = texture(diffuseMap, texCoord) * color;
+   OUT_col = texture(diffuseMap, texCoord) * color;
 }
 }

+ 2 - 2
Templates/Empty/game/shaders/common/gl/projectedShadowP.glsl

@@ -24,7 +24,7 @@ in vec2 texCoord;
 in vec4 color;
 in vec4 color;
 in float fade;
 in float fade;
 
 
-out vec4 OUT_FragColor0;
+out vec4 OUT_col;
 
 
 uniform sampler2D inputTex;
 uniform sampler2D inputTex;
 uniform vec4 ambient;
 uniform vec4 ambient;
@@ -33,5 +33,5 @@ uniform vec4 ambient;
 void main()
 void main()
 {   
 {   
 	float shadow = texture( inputTex, texCoord ).a * color.a;           
 	float shadow = texture( inputTex, texCoord ).a * color.a;           
-    OUT_FragColor0 = ( ambient * shadow ) + ( 1 - shadow );
+    OUT_col = ( ambient * shadow ) + ( 1 - shadow );
 }
 }

+ 5 - 3
Templates/Empty/game/shaders/common/gl/scatterSkyP.glsl

@@ -43,6 +43,8 @@ uniform float useCubemap;
 uniform vec3 lightDir;
 uniform vec3 lightDir;
 uniform vec3 sunDir;
 uniform vec3 sunDir;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 { 
 { 
 
 
@@ -62,7 +64,7 @@ void main()
 
 
    float fac = dot( normalize( pos ), sunDir );
    float fac = dot( normalize( pos ), sunDir );
    fac = max( nightInterpAndExposure.y, pow( clamp( fac, 0.0, 1.0 ), 2 ) );
    fac = max( nightInterpAndExposure.y, pow( clamp( fac, 0.0, 1.0 ), 2 ) );
-   OUT_FragColor0 = mix( color, nightSkyColor, nightInterpAndExposure.y );
+   OUT_col = mix( color, nightSkyColor, nightInterpAndExposure.y );
    
    
    // Clip based on the camera-relative
    // Clip based on the camera-relative
    // z position of the vertex, passed through
    // z position of the vertex, passed through
@@ -70,6 +72,6 @@ void main()
    if(zPosition < 0.0)
    if(zPosition < 0.0)
       discard;
       discard;
 
 
-   OUT_FragColor0.a = 1;
-   OUT_FragColor0 = hdrEncode( OUT_FragColor0 );
+   OUT_col.a = 1;
+   OUT_col = hdrEncode( OUT_col );
 }
 }

+ 1 - 1
Templates/Empty/game/shaders/common/gl/torque.glsl

@@ -267,6 +267,6 @@ void fizzle(vec2 vpos, float visibility)
 /// @param condition This should be a bvec[2-4].  If any items is false, condition is considered to fail.
 /// @param condition This should be a bvec[2-4].  If any items is false, condition is considered to fail.
 /// @param color The color that should be outputted if the condition fails.
 /// @param color The color that should be outputted if the condition fails.
 /// @note This macro will only work in the void main() method of a pixel shader.
 /// @note This macro will only work in the void main() method of a pixel shader.
-#define assert(condition, color) { if(!any(condition)) { OUT_FragColor0 = color; return; } }
+#define assert(condition, color) { if(!any(condition)) { OUT_col = color; return; } }
 
 
 #endif // _TORQUE_GLSL_
 #endif // _TORQUE_GLSL_

+ 4 - 2
Templates/Empty/game/shaders/common/gl/wavesP.glsl

@@ -33,6 +33,8 @@ in vec4 outLightVec;
 in vec3 outPos;
 in vec3 outPos;
 in vec3 outEyePos;
 in vec3 outEyePos;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    vec2 texOffset;
    vec2 texOffset;
@@ -45,11 +47,11 @@ void main()
    vec4 bumpNorm = texture(bumpMap, texOffset) * 2.0 - 1.0;
    vec4 bumpNorm = texture(bumpMap, texOffset) * 2.0 - 1.0;
    vec4 diffuse = texture(diffMap, texOffset);
    vec4 diffuse = texture(diffMap, texOffset);
    
    
-   OUT_FragColor0 = diffuse * (clamp(dot(outLightVec.xyz, bumpNorm.xyz), 0.0, 1.0) + ambient);
+   OUT_col = diffuse * (clamp(dot(outLightVec.xyz, bumpNorm.xyz), 0.0, 1.0) + ambient);
    
    
    vec3 eyeVec = normalize(outEyePos - outPos);
    vec3 eyeVec = normalize(outEyePos - outPos);
    vec3 halfAng = normalize(eyeVec + outLightVec.xyz);
    vec3 halfAng = normalize(eyeVec + outLightVec.xyz);
    float specular = clamp(dot(bumpNorm.xyz, halfAng), 0.0, 1.0) * outLightVec.w;
    float specular = clamp(dot(bumpNorm.xyz, halfAng), 0.0, 1.0) * outLightVec.w;
    specular = pow(specular, specularPower);
    specular = pow(specular, specularPower);
-   OUT_FragColor0 += specularColor * specular;
+   OUT_col += specularColor * specular;
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl

@@ -27,8 +27,10 @@ in vec2 uv0;
 uniform sampler2D prepassBuffer;
 uniform sampler2D prepassBuffer;
 uniform sampler1D depthViz;
 uniform sampler1D depthViz;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    float depth = prepassUncondition( prepassBuffer, uv0 ).w;
    float depth = prepassUncondition( prepassBuffer, uv0 ).w;
-   OUT_FragColor0 = vec4( texture( depthViz, depth ).rgb, 1.0 );
+   OUT_col = vec4( texture( depthViz, depth ).rgb, 1.0 );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl

@@ -26,10 +26,12 @@
 in vec2 uv0;
 in vec2 uv0;
 uniform sampler2D lightInfoBuffer;
 uniform sampler2D lightInfoBuffer;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {   
 {   
    vec3 lightcolor;   
    vec3 lightcolor;   
    float nl_Att, specular;   
    float nl_Att, specular;   
    lightinfoUncondition( texture( lightInfoBuffer, uv0 ), lightcolor, nl_Att, specular );   
    lightinfoUncondition( texture( lightInfoBuffer, uv0 ), lightcolor, nl_Att, specular );   
-   OUT_FragColor0 = vec4( lightcolor, 1.0 ); 
+   OUT_col = vec4( lightcolor, 1.0 ); 
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl

@@ -26,10 +26,12 @@
 in vec2 uv0;
 in vec2 uv0;
 uniform sampler2D lightInfoBuffer;
 uniform sampler2D lightInfoBuffer;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {   
 {   
    vec3 lightcolor;   
    vec3 lightcolor;   
    float nl_Att, specular;   
    float nl_Att, specular;   
    lightinfoUncondition( texture( lightInfoBuffer, uv0 ), lightcolor, nl_Att, specular );   
    lightinfoUncondition( texture( lightInfoBuffer, uv0 ), lightcolor, nl_Att, specular );   
-   OUT_FragColor0 = vec4( specular, specular, specular, 1.0 );
+   OUT_col = vec4( specular, specular, specular, 1.0 );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl

@@ -26,8 +26,10 @@
 in vec2 uv0;
 in vec2 uv0;
 uniform sampler2D prepassBuffer;
 uniform sampler2D prepassBuffer;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {   
 {   
    vec3 normal = prepassUncondition( prepassBuffer, uv0 ).xyz;
    vec3 normal = prepassUncondition( prepassBuffer, uv0 ).xyz;
-   OUT_FragColor0 = vec4( ( normal + 1.0 ) * 0.5, 1.0 );
+   OUT_col = vec4( ( normal + 1.0 ) * 0.5, 1.0 );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl

@@ -25,8 +25,10 @@ in vec2 uv0;
 uniform sampler2D shadowMap;
 uniform sampler2D shadowMap;
 uniform sampler1D depthViz;
 uniform sampler1D depthViz;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    float depth = saturate( texture( shadowMap, uv0 ).r );
    float depth = saturate( texture( shadowMap, uv0 ).r );
-   OUT_FragColor0 = vec4( texture( depthViz, depth ).rgb, 1 );
+   OUT_col = vec4( texture( depthViz, depth ).rgb, 1 );
 }
 }

+ 2 - 1
Templates/Empty/game/shaders/common/lighting/advanced/gl/pointLightP.glsl

@@ -122,6 +122,7 @@ uniform mat3 viewToLightProj;
 uniform vec4 lightParams;
 uniform vec4 lightParams;
 uniform float shadowSoftness;
 uniform float shadowSoftness;
 			   
 			   
+out vec4 OUT_col;
 
 
 void main()               
 void main()               
 {   
 {   
@@ -229,5 +230,5 @@ void main()
       addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
       addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
    }
    }
 
 
-   OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );
+   OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/lighting/advanced/gl/spotLightP.glsl

@@ -63,6 +63,8 @@ uniform mat4 viewToLightProj;
 uniform vec4 lightParams;
 uniform vec4 lightParams;
 uniform float shadowSoftness;
 uniform float shadowSoftness;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {   
 {   
    // Compute scene UV
    // Compute scene UV
@@ -162,5 +164,5 @@ void main()
       addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
       addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
    }
    }
 
 
-   OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );
+   OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl

@@ -62,6 +62,8 @@ uniform vec4 farPlaneScalePSSM;
 uniform vec4 overDarkPSSM;
 uniform vec4 overDarkPSSM;
 uniform float shadowSoftness;
 uniform float shadowSoftness;
 
 
+out vec4 OUT_col;
+
 void main()             
 void main()             
 {
 {
    // Sample/unpack the normal/z data
    // Sample/unpack the normal/z data
@@ -227,6 +229,6 @@ void main()
       lightColorOut = debugColor;
       lightColorOut = debugColor;
    #endif
    #endif
    
    
-   OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );  
+   OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );  
    
    
 }
 }

+ 5 - 5
Templates/Empty/game/shaders/common/lighting/basic/gl/shadowFilterP.glsl

@@ -31,16 +31,16 @@ uniform vec2 oneOverTargetSize;
 const float offset[3] = float[]( 0.0, 1.3846153846, 3.2307692308 );
 const float offset[3] = float[]( 0.0, 1.3846153846, 3.2307692308 );
 const float weight[3] = float[]( 0.2270270270, 0.3162162162, 0.0702702703 );
 const float weight[3] = float[]( 0.2270270270, 0.3162162162, 0.0702702703 );
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
-   vec4 OUT = texture( diffuseMap, uv ) * weight[0];
+   OUT_col = texture( diffuseMap, uv ) * weight[0];
    
    
    for ( int i=1; i < 3; i++ )
    for ( int i=1; i < 3; i++ )
    {
    {
       vec2 _sample = (BLUR_DIR * offset[i]) * oneOverTargetSize;
       vec2 _sample = (BLUR_DIR * offset[i]) * oneOverTargetSize;
-      OUT += texture( diffuseMap, uv + _sample ) * weight[i];  
-      OUT += texture( diffuseMap, uv - _sample ) * weight[i];  
+      OUT_col += texture( diffuseMap, uv + _sample ) * weight[i];  
+      OUT_col += texture( diffuseMap, uv - _sample ) * weight[i];  
    }
    }
-
-   OUT_FragColor0 = OUT;
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl

@@ -28,6 +28,8 @@ uniform vec2 blurDimension;
 
 
 in vec2 tex0;
 in vec2 tex0;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    // Preshader
    // Preshader
@@ -43,5 +45,5 @@ void main()
       accum += texture(diffuseMap0, BaseTexCoord + float(i) * SampleOffset);
       accum += texture(diffuseMap0, BaseTexCoord + float(i) * SampleOffset);
    }
    }
    accum /= blurSamples;
    accum /= blurSamples;
-   OUT_FragColor0 = accum;
+   OUT_col = accum;
 }
 }

+ 5 - 3
Templates/Empty/game/shaders/common/postFx/caustics/gl/causticsP.glsl

@@ -34,6 +34,8 @@ uniform sampler2D causticsTex0;
 uniform sampler2D causticsTex1;
 uniform sampler2D causticsTex1;
 uniform vec2 targetSize;
 uniform vec2 targetSize;
 
 
+out vec4 OUT_col;
+
 float distanceToPlane(vec4 plane, vec3 pos)
 float distanceToPlane(vec4 plane, vec3 pos)
 {
 {
    return (plane.x * pos.x + plane.y * pos.y + plane.z * pos.z) + plane.w;
    return (plane.x * pos.x + plane.y * pos.y + plane.z * pos.z) + plane.w;
@@ -48,7 +50,7 @@ void main()
    float depth = prePass.w;   
    float depth = prePass.w;   
    if(depth > 0.9999)
    if(depth > 0.9999)
    {
    {
-      OUT_FragColor0 = vec4(0,0,0,0);
+      OUT_col = vec4(0,0,0,0);
       return;
       return;
    }
    }
    
    
@@ -59,7 +61,7 @@ void main()
    float waterDepth = -distanceToPlane(waterFogPlane, pos);
    float waterDepth = -distanceToPlane(waterFogPlane, pos);
    if(waterDepth < 0)
    if(waterDepth < 0)
    {
    {
-      OUT_FragColor0 = vec4(0,0,0,0);
+      OUT_col = vec4(0,0,0,0);
       return;
       return;
    }
    }
    waterDepth = saturate(waterDepth);
    waterDepth = saturate(waterDepth);
@@ -81,5 +83,5 @@ void main()
    //float waterDepth = 1 - saturate(pos.z + waterFogPlane.w + 1);
    //float waterDepth = 1 - saturate(pos.z + waterFogPlane.w + 1);
    caustics *= saturate(prePass.z) * pow(1-depth, 64) * waterDepth; 
    caustics *= saturate(prePass.z) * pow(1-depth, 64) * waterDepth; 
       
       
-   OUT_FragColor0 = caustics;   
+   OUT_col = caustics;   
 }
 }

+ 7 - 5
Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl

@@ -25,7 +25,9 @@
 
 
 // These are set by the game engine.  
 // These are set by the game engine.  
 uniform sampler2D shrunkSampler;  // Output of DofDownsample()  
 uniform sampler2D shrunkSampler;  // Output of DofDownsample()  
-uniform sampler2D blurredSampler; // Blurred version of the shrunk sampler  
+uniform sampler2D blurredSampler; // Blurred version of the shrunk sampler
+
+out vec4 OUT_col;
 
 
 // This is the pixel shader function that calculates the actual  
 // This is the pixel shader function that calculates the actual  
 // value used for the near circle of confusion.  
 // value used for the near circle of confusion.  
@@ -46,8 +48,8 @@ void main()
    coc = 2 * max( blurred.a, shrunk.a ) - shrunk.a;  
    coc = 2 * max( blurred.a, shrunk.a ) - shrunk.a;  
    
    
    
    
-   //OUT_FragColor0 = vec4( coc.rrr, 1.0 );
-   //OUT_FragColor0 = vec4( color, 1.0 );
-   OUT_FragColor0 = vec4( color, coc );  
-   //OUT_FragColor0 = vec4( 1.0, 0.0, 1.0, 1.0 );
+   //OUT_col = vec4( coc.rrr, 1.0 );
+   //OUT_col = vec4( color, 1.0 );
+   OUT_col = vec4( color, coc );  
+   //OUT_col = vec4( 1.0, 0.0, 1.0, 1.0 );
 }
 }

+ 6 - 4
Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl

@@ -47,6 +47,8 @@ in vec2 tcDepth2;
 in vec2 tcDepth3;
 in vec2 tcDepth3;
 #define IN_tcDepth3 tcDepth3
 #define IN_tcDepth3 tcDepth3
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {  
 {  
    //return vec4( 1.0, 0.0, 1.0, 1.0 );
    //return vec4( 1.0, 0.0, 1.0, 1.0 );
@@ -131,8 +133,8 @@ void main()
    
    
    maxCoc = max( max( coc[0], coc[1] ), max( coc[2], coc[3] ) );  
    maxCoc = max( max( coc[0], coc[1] ), max( coc[2], coc[3] ) );  
    
    
-   //OUT_FragColor0 = half4( 1.0, 0.0, 1.0, 1.0 );
-   OUT_FragColor0 = half4( color, maxCoc );  
-   //OUT_FragColor0 = half4( color, 1.0f );
-   //OUT_FragColor0 = half4( maxCoc.rrr, 1.0 );
+   //OUT_col = half4( 1.0, 0.0, 1.0, 1.0 );
+   OUT_col = half4( color, maxCoc );  
+   //OUT_col = half4( color, 1.0f );
+   //OUT_col = half4( maxCoc.rrr, 1.0 );
 }  
 }  

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_Final_P.glsl

@@ -41,6 +41,8 @@ uniform float maxFarCoC;
 //static vec4 dofLerpBias = vec4( 1.0, (1.0 - d2) / d1, 1.0 / d2, (d2 - 1.0) / d2 );
 //static vec4 dofLerpBias = vec4( 1.0, (1.0 - d2) / d1, 1.0 / d2, (d2 - 1.0) / d2 );
 //static vec3 dofEqFar = vec3( 2.0, 0.0, 1.0 ); 
 //static vec3 dofEqFar = vec3( 2.0, 0.0, 1.0 ); 
 
 
+out vec4 OUT_col;
+
 vec4 tex2Doffset( sampler2D s, vec2 tc, vec2 offset )  
 vec4 tex2Doffset( sampler2D s, vec2 tc, vec2 offset )  
 {  
 {  
    return texture( s, tc + offset * oneOverTargetSize );  
    return texture( s, tc + offset * oneOverTargetSize );  
@@ -141,5 +143,5 @@ void main()
    //return half4(nearCoc.rrr,1);
    //return half4(nearCoc.rrr,1);
    
    
    //return half4( 1,0,1,0 );
    //return half4( 1,0,1,0 );
-   OUT_FragColor0 = InterpolateDof( small, med.rgb, large, coc );  
+   OUT_col = InterpolateDof( small, med.rgb, large, coc );  
 }  
 }  

+ 11 - 11
Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_Gausian_P.glsl

@@ -42,7 +42,7 @@ in vec2 uv6;
 in vec2 uv7;
 in vec2 uv7;
 #define IN_uv7 uv7
 #define IN_uv7 uv7
 
 
-#define OUT OUT_FragColor0
+out vec4 OUT_col;
 
 
 uniform sampler2D diffuseMap;
 uniform sampler2D diffuseMap;
 
 
@@ -50,19 +50,19 @@ void main()
 {
 {
    vec4 kernel = vec4( 0.175, 0.275, 0.375, 0.475 ) * 0.5 / 1.3; //25f;
    vec4 kernel = vec4( 0.175, 0.275, 0.375, 0.475 ) * 0.5 / 1.3; //25f;
 
 
-   OUT = vec4(0);
-   OUT += texture( diffuseMap, IN_uv0 ) * kernel.x;
-   OUT += texture( diffuseMap, IN_uv1 ) * kernel.y;
-   OUT += texture( diffuseMap, IN_uv2 ) * kernel.z;
-   OUT += texture( diffuseMap, IN_uv3 ) * kernel.w;
+   OUT_col = vec4(0);
+   OUT_col += texture( diffuseMap, IN_uv0 ) * kernel.x;
+   OUT_col += texture( diffuseMap, IN_uv1 ) * kernel.y;
+   OUT_col += texture( diffuseMap, IN_uv2 ) * kernel.z;
+   OUT_col += texture( diffuseMap, IN_uv3 ) * kernel.w;
 
 
-   OUT += texture( diffuseMap, IN_uv4 ) * kernel.x;
-   OUT += texture( diffuseMap, IN_uv5 ) * kernel.y;
-   OUT += texture( diffuseMap, IN_uv6 ) * kernel.z;
-   OUT += texture( diffuseMap, IN_uv7 ) * kernel.w;
+   OUT_col += texture( diffuseMap, IN_uv4 ) * kernel.x;
+   OUT_col += texture( diffuseMap, IN_uv5 ) * kernel.y;
+   OUT_col += texture( diffuseMap, IN_uv6 ) * kernel.z;
+   OUT_col += texture( diffuseMap, IN_uv7 ) * kernel.w;
 
 
    // Calculate a lumenance value in the alpha so we
    // Calculate a lumenance value in the alpha so we
    // can use alpha test to save fillrate.
    // can use alpha test to save fillrate.
    //vec3 rgb2lum = vec3( 0.30, 0.59, 0.11 );
    //vec3 rgb2lum = vec3( 0.30, 0.59, 0.11 );
-   //OUT.a = dot( OUT.rgb, rgb2lum );   
+   //OUT_col.a = dot( OUT_col.rgb, rgb2lum );   
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_SmallBlur_P.glsl

@@ -32,6 +32,8 @@ uniform sampler2D colorSampler;  // Output of DofNearCoc()
 in vec4 texCoords;
 in vec4 texCoords;
 #define IN_texCoords texCoords
 #define IN_texCoords texCoords
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {  
 {  
    vec4 color;
    vec4 color;
@@ -40,5 +42,5 @@ void main()
    color += texture( colorSampler, IN_texCoords.yz );  
    color += texture( colorSampler, IN_texCoords.yz );  
    color += texture( colorSampler, IN_texCoords.xw );  
    color += texture( colorSampler, IN_texCoords.xw );  
    color += texture( colorSampler, IN_texCoords.yw );  
    color += texture( colorSampler, IN_texCoords.yw );  
-   OUT_FragColor0 = color / 4.0;  
+   OUT_col = color / 4.0;  
 }  
 }  

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/edgeaa/gl/dbgEdgeDisplayP.glsl

@@ -28,7 +28,9 @@ in vec2 uv0;
 
 
 uniform sampler2D edgeBuffer;
 uniform sampler2D edgeBuffer;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = vec4( texture( edgeBuffer, IN_uv0 ).rrr, 1.0 );
+   OUT_col = vec4( texture( edgeBuffer, IN_uv0 ).rrr, 1.0 );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeAAP.glsl

@@ -28,6 +28,8 @@ uniform sampler2D edgeBuffer;
 uniform sampler2D backBuffer;
 uniform sampler2D backBuffer;
 uniform vec2 targetSize;
 uniform vec2 targetSize;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    vec2 pixelSize = 1.0 / targetSize;
    vec2 pixelSize = 1.0 / targetSize;
@@ -64,5 +66,5 @@ void main()
    }
    }
    accumColor /= 9.0;
    accumColor /= 9.0;
    
    
-   OUT_FragColor0 = accumColor;
+   OUT_col = accumColor;
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeDetectP.glsl

@@ -88,7 +88,9 @@ in vec2 uv0;
 uniform sampler2D prepassBuffer;
 uniform sampler2D prepassBuffer;
 uniform vec2 targetSize;
 uniform vec2 targetSize;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = vec4( GetEdgeWeight(IN_uv0, prepassBuffer, targetSize ) );//rtWidthHeightInvWidthNegHeight.zw);
+   OUT_col = vec4( GetEdgeWeight(IN_uv0, prepassBuffer, targetSize ) );//rtWidthHeightInvWidthNegHeight.zw);
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/fxaa/gl/fxaaP.glsl

@@ -34,9 +34,11 @@ uniform vec2 oneOverTargetSize;
 in vec4 hpos;
 in vec4 hpos;
 in vec2 uv0;
 in vec2 uv0;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = FxaaPixelShader(
+   OUT_col = FxaaPixelShader(
 
 
     uv0, // vertex position
     uv0, // vertex position
 
 

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/gl/chromaticLens.glsl

@@ -32,6 +32,8 @@ uniform float distCoeff;
 uniform float cubeDistort;
 uniform float cubeDistort;
 uniform vec3 colorDistort;
 uniform vec3 colorDistort;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
     vec2 tex = IN_uv0;
     vec2 tex = IN_uv0;
@@ -56,5 +58,5 @@ void main()
         outColor[i] = tex2Dlod( backBuffer, vec4(x,y,0,0) )[i];
         outColor[i] = tex2Dlod( backBuffer, vec4(x,y,0,0) )[i];
     }
     }
 
 
-    OUT_FragColor0 = vec4( outColor.rgb, 1 );
+    OUT_col = vec4( outColor.rgb, 1 );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/gl/flashP.glsl

@@ -28,10 +28,12 @@ uniform float damageFlash;
 uniform float whiteOut;
 uniform float whiteOut;
 uniform sampler2D backBuffer;
 uniform sampler2D backBuffer;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
  vec4 color1 = texture(backBuffer, IN_uv0); 
  vec4 color1 = texture(backBuffer, IN_uv0); 
  vec4 color2 = color1 * MUL_COLOR;
  vec4 color2 = color1 * MUL_COLOR;
  vec4 damage = mix(color1,color2,damageFlash);
  vec4 damage = mix(color1,color2,damageFlash);
- OUT_FragColor0 = mix(damage,WHITE_COLOR,whiteOut);
+ OUT_col = mix(damage,WHITE_COLOR,whiteOut);
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/gl/fogP.glsl

@@ -34,6 +34,8 @@ uniform vec4    rtParams0;
 in vec2 uv0;
 in vec2 uv0;
 in vec3 wsEyeRay;
 in vec3 wsEyeRay;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {   
 {   
    //vec2 prepassCoord = ( uv0.xy * rtParams0.zw ) + rtParams0.xy;   
    //vec2 prepassCoord = ( uv0.xy * rtParams0.zw ) + rtParams0.xy;   
@@ -46,5 +48,5 @@ void main()
                                    fogData.y, 
                                    fogData.y, 
                                    fogData.z );
                                    fogData.z );
 
 
-   OUT_FragColor0 = hdrEncode( vec4( fogColor.rgb, 1.0 - saturate( factor ) ) );     
+   OUT_col = hdrEncode( vec4( fogColor.rgb, 1.0 - saturate( factor ) ) );     
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/gl/gammaP.glsl

@@ -31,6 +31,8 @@ uniform float OneOverGamma;
 
 
 in vec2 uv0;
 in vec2 uv0;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
     vec4 color = texture(backBuffer, uv0.xy);
     vec4 color = texture(backBuffer, uv0.xy);
@@ -43,5 +45,5 @@ void main()
    // Apply gamma correction
    // Apply gamma correction
    color.rgb = pow( abs(color.rgb), vec3(OneOverGamma) );
    color.rgb = pow( abs(color.rgb), vec3(OneOverGamma) );
 
 
-   OUT_FragColor0 = color;
+   OUT_col = color;
 }
 }

+ 15 - 14
Templates/Empty/game/shaders/common/postFx/gl/glowBlurP.glsl

@@ -34,25 +34,26 @@ in vec2 uv5; //TEXCOORD5;
 in vec2 uv6; //TEXCOORD6;
 in vec2 uv6; //TEXCOORD6;
 in vec2 uv7; //TEXCOORD7;
 in vec2 uv7; //TEXCOORD7;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    vec4 kernel = vec4( 0.175, 0.275, 0.375, 0.475 ) * 0.5f;
    vec4 kernel = vec4( 0.175, 0.275, 0.375, 0.475 ) * 0.5f;
-
-   vec4 OUT = vec4(0);
-   OUT += texture( diffuseMap, uv0 ) * kernel.x;
-   OUT += texture( diffuseMap, uv1 ) * kernel.y;
-   OUT += texture( diffuseMap, uv2 ) * kernel.z;
-   OUT += texture( diffuseMap, uv3 ) * kernel.w;
-
-   OUT += texture( diffuseMap, uv4 ) * kernel.x;
-   OUT += texture( diffuseMap, uv5 ) * kernel.y;
-   OUT += texture( diffuseMap, uv6 ) * kernel.z;
-   OUT += texture( diffuseMap, uv7 ) * kernel.w;
+   
+   vec4 OUT_col = vec4(0);
+   OUT_col += texture( diffuseMap, uv0 ) * kernel.x;
+   OUT_col += texture( diffuseMap, uv1 ) * kernel.y;
+   OUT_col += texture( diffuseMap, uv2 ) * kernel.z;
+   OUT_col += texture( diffuseMap, uv3 ) * kernel.w;
+
+   OUT_col += texture( diffuseMap, uv4 ) * kernel.x;
+   OUT_col += texture( diffuseMap, uv5 ) * kernel.y;
+   OUT_col += texture( diffuseMap, uv6 ) * kernel.z;
+   OUT_col += texture( diffuseMap, uv7 ) * kernel.w;
 
 
    // Calculate a lumenance value in the alpha so we
    // Calculate a lumenance value in the alpha so we
    // can use alpha test to save fillrate.
    // can use alpha test to save fillrate.
    vec3 rgb2lum = vec3( 0.30, 0.59, 0.11 );
    vec3 rgb2lum = vec3( 0.30, 0.59, 0.11 );
-   OUT.a = dot( OUT.rgb, rgb2lum );
-
-   OUT_FragColor0 = OUT;
+   OUT_col.a = dot( OUT_col.rgb, rgb2lum );
+   
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/gl/motionBlurP.glsl

@@ -37,6 +37,8 @@ uniform float velocityMultiplier;
 uniform sampler2D backBuffer;
 uniform sampler2D backBuffer;
 uniform sampler2D prepassTex;
 uniform sampler2D prepassTex;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    vec2 IN_uv0 = _IN_uv0;
    vec2 IN_uv0 = _IN_uv0;
@@ -72,5 +74,5 @@ void main()
       color += currentColor;
       color += currentColor;
    }
    }
    
    
-   OUT_FragColor0 = color / samples;
+   OUT_col = color / samples;
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/gl/passthruP.glsl

@@ -25,7 +25,9 @@
 in vec2 uv0;
 in vec2 uv0;
 uniform sampler2D inputTex ;
 uniform sampler2D inputTex ;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = texture( inputTex, uv0 );   
+   OUT_col = texture( inputTex, uv0 );   
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/gl/turbulenceP.glsl

@@ -34,6 +34,8 @@ in vec2 uv0;
 
 
 #define IN_uv0 uv0
 #define IN_uv0 uv0
 
 
+out vec4 OUT_col;
+
 void main() 
 void main() 
 {
 {
 	float speed = 2.0;
 	float speed = 2.0;
@@ -46,5 +48,5 @@ void main()
 	y = clamp(y, targetViewport.y, targetViewport.w);
 	y = clamp(y, targetViewport.y, targetViewport.w);
 	x = clamp(x, targetViewport.x, targetViewport.z);
 	x = clamp(x, targetViewport.x, targetViewport.z);
 
 
-   OUT_FragColor0 = texture (inputTex, vec2(x, y));
+   OUT_col = texture (inputTex, vec2(x, y));
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/gl/underwaterFogP.glsl

@@ -51,6 +51,8 @@ uniform vec2    nearFar;
 uniform vec4    rtParams0;
 uniform vec4    rtParams0;
 uniform float     waterDepthGradMax;
 uniform float     waterDepthGradMax;
 
 
+out vec4 OUT_col;
+
 void main() 
 void main() 
 {    
 {    
    //vec2 prepassCoord = IN_uv0;
    //vec2 prepassCoord = IN_uv0;
@@ -134,5 +136,5 @@ void main()
    
    
    vec3 outColor = mix( inColor, fogColor.rgb, fogAmt );
    vec3 outColor = mix( inColor, fogColor.rgb, fogAmt );
    
    
-   OUT_FragColor0 = vec4( hdrEncode( outColor ), 1 );        
+   OUT_col = vec4( hdrEncode( outColor ), 1 );        
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurHP.glsl

@@ -30,6 +30,8 @@ uniform float gaussMultiplier;
 uniform float gaussMean;
 uniform float gaussMean;
 uniform float gaussStdDev;
 uniform float gaussStdDev;
 
 
+out vec4 OUT_col;
+
 #define PI 3.141592654
 #define PI 3.141592654
 
 
 float computeGaussianValue( float x, float mean, float std_deviation )
 float computeGaussianValue( float x, float mean, float std_deviation )
@@ -66,5 +68,5 @@ void main()
       color += (texture( inputTex, IN_uv0 + vec2( offset, 0.0f ) ) * weight );
       color += (texture( inputTex, IN_uv0 + vec2( offset, 0.0f ) ) * weight );
    }
    }
    
    
-   OUT_FragColor0 = vec4( color.rgb, 1.0f );
+   OUT_col = vec4( color.rgb, 1.0f );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurVP.glsl

@@ -30,6 +30,8 @@ uniform float gaussMultiplier;
 uniform float gaussMean;
 uniform float gaussMean;
 uniform float gaussStdDev;
 uniform float gaussStdDev;
 
 
+out vec4 OUT_col;
+
 #define D3DX_PI 3.141592654
 #define D3DX_PI 3.141592654
 
 
 float computeGaussianValue( float x, float mean, float std_deviation )
 float computeGaussianValue( float x, float mean, float std_deviation )
@@ -65,5 +67,5 @@ void main()
       color += (texture( inputTex, IN_uv0 + vec2( 0.0f, offset ) ) * weight );
       color += (texture( inputTex, IN_uv0 + vec2( 0.0f, offset ) ) * weight );
    }
    }
 
 
-   OUT_FragColor0 = vec4( color.rgb, 1.0f );
+   OUT_col = vec4( color.rgb, 1.0f );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/hdr/gl/brightPassFilterP.glsl

@@ -33,6 +33,8 @@ uniform float g_fMiddleGray;
 
 
 const vec3 LUMINANCE_VECTOR = vec3(0.3125f, 0.6154f, 0.0721f);
 const vec3 LUMINANCE_VECTOR = vec3(0.3125f, 0.6154f, 0.0721f);
 
 
+out vec4 OUT_col;
+
 
 
 const vec2 gTapOffsets[4] = vec2[]
 const vec2 gTapOffsets[4] = vec2[]
 (
 (
@@ -59,5 +61,5 @@ void main()
       average = vec4( 0.0f, 0.0f, 0.0f, 1.0f );
       average = vec4( 0.0f, 0.0f, 0.0f, 1.0f );
 
 
    // Write the colour to the bright-pass render target
    // Write the colour to the bright-pass render target
-   OUT_FragColor0 = hdrEncode( average );
+   OUT_col = hdrEncode( average );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/hdr/gl/calculateAdaptedLumP.glsl

@@ -30,6 +30,8 @@ uniform sampler2D lastAdaptedLum;
 uniform float adaptRate;
 uniform float adaptRate;
 uniform float deltaTime;
 uniform float deltaTime;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    float fAdaptedLum = texture( lastAdaptedLum, vec2(0.5f, 0.5f) ).r;
    float fAdaptedLum = texture( lastAdaptedLum, vec2(0.5f, 0.5f) ).r;
@@ -42,5 +44,5 @@ void main()
    float diff = fCurrentLum - fAdaptedLum;
    float diff = fCurrentLum - fAdaptedLum;
    float fNewAdaptation = fAdaptedLum + ( diff * ( 1.0 - exp( -deltaTime * adaptRate ) ) );
    float fNewAdaptation = fAdaptedLum + ( diff * ( 1.0 - exp( -deltaTime * adaptRate ) ) );
 
 
-   OUT_FragColor0 = vec4( fNewAdaptation, 0.0, 0.0, 1.0f );
+   OUT_col = vec4( fNewAdaptation, 0.0, 0.0, 1.0f );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/hdr/gl/downScale4x4P.glsl

@@ -30,6 +30,8 @@ in vec4 texCoords[8];
 
 
 uniform sampler2D inputTex;
 uniform sampler2D inputTex;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Main
 // Main
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -44,5 +46,5 @@ void main()
       _sample += texture( inputTex, IN_texCoords[i].zw );
       _sample += texture( inputTex, IN_texCoords[i].zw );
    }
    }
    
    
-	OUT_FragColor0 = _sample / 16;
+	OUT_col = _sample / 16;
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/hdr/gl/finalPassCombineP.glsl

@@ -43,6 +43,8 @@ uniform float g_fBloomScale;
 
 
 uniform float g_fOneOverGamma;
 uniform float g_fOneOverGamma;
 
 
+out vec4 OUT_col;
+
 
 
 void main()
 void main()
 {
 {
@@ -92,5 +94,5 @@ void main()
    // Apply gamma correction
    // Apply gamma correction
    _sample.rgb = pow( abs(_sample.rgb), vec3(g_fOneOverGamma) );
    _sample.rgb = pow( abs(_sample.rgb), vec3(g_fOneOverGamma) );
 
 
-   OUT_FragColor0 = _sample;
+   OUT_col = _sample;
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/hdr/gl/luminanceVisP.glsl

@@ -28,6 +28,8 @@
 uniform sampler2D inputTex;
 uniform sampler2D inputTex;
 uniform float brightPassThreshold;
 uniform float brightPassThreshold;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    vec4 _sample = hdrDecode( texture( inputTex, IN_uv0 ) );
    vec4 _sample = hdrDecode( texture( inputTex, IN_uv0 ) );
@@ -36,5 +38,5 @@ void main()
    float lum = hdrLuminance( _sample.rgb );
    float lum = hdrLuminance( _sample.rgb );
 
 
    // Write the colour to the bright-pass render target
    // Write the colour to the bright-pass render target
-   OUT_FragColor0 = ( vec4( lum.rrr, 1 ) );
+   OUT_col = ( vec4( lum.rrr, 1 ) );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumInitialP.glsl

@@ -29,6 +29,8 @@ uniform vec2 texSize0;
 
 
 uniform float g_fMinLuminace;
 uniform float g_fMinLuminace;
 
 
+out vec4 OUT_col;
+
 const vec2 gTapOffsets[9] = vec2[]
 const vec2 gTapOffsets[9] = vec2[]
 (
 (
    vec2( -1.0, -1.0 ), vec2( 0.0, -1.0 ), vec2( 1.0, -1.0 ),
    vec2( -1.0, -1.0 ), vec2( 0.0, -1.0 ), vec2( 1.0, -1.0 ),
@@ -56,5 +58,5 @@ void main()
 
 
    average = exp( average / 9.0 );
    average = exp( average / 9.0 );
 
 
-   OUT_FragColor0 = vec4( average, 0.0, 0.0, 1.0 );
+   OUT_col = vec4( average, 0.0, 0.0, 1.0 );
 }
 }

+ 2 - 1
Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumIterativeP.glsl

@@ -26,6 +26,7 @@
 uniform sampler2D inputTex;
 uniform sampler2D inputTex;
 uniform vec2 oneOverTargetSize;
 uniform vec2 oneOverTargetSize;
 
 
+out vec4 OUT_col;
 
 
 const vec2 gTapOffsets[16] = vec2[]
 const vec2 gTapOffsets[16] = vec2[]
 (
 (
@@ -47,5 +48,5 @@ void main()
       average += lum;
       average += lum;
    }
    }
 
 
-   OUT_FragColor0 = vec4( average / 16.0, 0.0, 0.0, 1.0 );
+   OUT_col = vec4( average / 16.0, 0.0, 0.0, 1.0 );
 }
 }

+ 2 - 1
Templates/Empty/game/shaders/common/postFx/lightRay/gl/lightRayOccludeP.glsl

@@ -31,6 +31,7 @@ uniform float brightScalar;
 
 
 const vec3 LUMINANCE_VECTOR = vec3(0.3125f, 0.6154f, 0.0721f);
 const vec3 LUMINANCE_VECTOR = vec3(0.3125f, 0.6154f, 0.0721f);
 
 
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {
 {
@@ -50,5 +51,5 @@ void main()
         col *= brightScalar;
         col *= brightScalar;
     }
     }
     
     
-    OUT_FragColor0 = col;
+    OUT_col = col;
 }
 }

+ 4 - 2
Templates/Empty/game/shaders/common/postFx/lightRay/gl/lightRayP.glsl

@@ -36,6 +36,8 @@ uniform float weight;
 uniform float decay;
 uniform float decay;
 uniform float exposure;
 uniform float exposure;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {  
 {  
     vec4 texCoord = vec4( IN_uv0.xy, 0, 0 );        
     vec4 texCoord = vec4( IN_uv0.xy, 0, 0 );        
@@ -55,7 +57,7 @@ void main()
 	
 	
 	if ( samples <= 0 )
 	if ( samples <= 0 )
    {
    {
-	   OUT_FragColor0 = bbCol;
+	   OUT_col = bbCol;
       return;
       return;
    }
    }
 
 
@@ -88,5 +90,5 @@ void main()
 	//return bbCol * decay;
 	//return bbCol * decay;
 	
 	
     // Output final color with a further scale control factor.      
     // Output final color with a further scale control factor.      
-    OUT_FragColor0 = saturate( amount ) * vec4( color * exposure, 1 ) + bbCol;
+    OUT_col = saturate( amount ) * vec4( color * exposure, 1 ) + bbCol;
 }  
 }  

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/mlaa/gl/blendWeightCalculationP.glsl

@@ -34,6 +34,8 @@ uniform sampler2D edgesMap;
 uniform sampler2D edgesMapL;
 uniform sampler2D edgesMapL;
 uniform sampler2D areaMap;
 uniform sampler2D areaMap;
 
 
+out vec4 OUT_col;
+
 #include "./functions.glsl"
 #include "./functions.glsl"
 
 
 
 
@@ -77,5 +79,5 @@ void main()
       areas.ba = Area(abs(d), e1, e2);
       areas.ba = Area(abs(d), e1, e2);
    }
    }
 
 
-   OUT_FragColor0 = areas;
+   OUT_col = areas;
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/mlaa/gl/edgeDetectionP.glsl

@@ -39,6 +39,8 @@ uniform float depthThreshold;
 in vec2 texcoord;
 in vec2 texcoord;
 in vec4 offset[2];
 in vec4 offset[2];
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    // Luma calculation requires gamma-corrected colors (texture 'colorMapG').
    // Luma calculation requires gamma-corrected colors (texture 'colorMapG').
@@ -70,5 +72,5 @@ void main()
    if (dot(edges, vec4(1.0)) == 0.0)
    if (dot(edges, vec4(1.0)) == 0.0)
       discard;
       discard;
 
 
-   OUT_FragColor0 = edges;
+   OUT_col = edges;
 }
 }

+ 2 - 1
Templates/Empty/game/shaders/common/postFx/mlaa/gl/neighborhoodBlendingP.glsl

@@ -40,6 +40,7 @@ uniform sampler2D areaMap;
 uniform sampler2D edgesMapL;
 uniform sampler2D edgesMapL;
 #include "./functions.glsl"
 #include "./functions.glsl"
 
 
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {
 {
@@ -83,5 +84,5 @@ void main()
    #endif
    #endif
 
 
    // Normalize the resulting color and we are finished!
    // Normalize the resulting color and we are finished!
-   OUT_FragColor0 = color / sum; 
+   OUT_col = color / sum; 
 }
 }

+ 2 - 1
Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_Blur_P.glsl

@@ -46,6 +46,7 @@ uniform sampler2D prepassMap ;
 uniform float blurDepthTol;
 uniform float blurDepthTol;
 uniform float blurNormalTol;
 uniform float blurNormalTol;
 
 
+out vec4 OUT_col;
 
 
 void _sample( vec2 uv, float weight, vec4 centerTap, inout int usedCount, inout float occlusion, inout float total )
 void _sample( vec2 uv, float weight, vec4 centerTap, inout int usedCount, inout float occlusion, inout float total )
 {
 {
@@ -96,7 +97,7 @@ void main()
    //occlusion /= (float)usedCount / 8.0;
    //occlusion /= (float)usedCount / 8.0;
    occlusion /= total;
    occlusion /= total;
    
    
-   OUT_FragColor0 = vec4( vec3(occlusion), 1 );   
+   OUT_col = vec4( vec3(occlusion), 1 );   
    
    
    
    
    //return vec4( 0,0,0,occlusion );
    //return vec4( 0,0,0,occlusion );

+ 4 - 2
Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_P.glsl

@@ -57,6 +57,8 @@ uniform float lDepthPow;
 uniform float lNormalTol;
 uniform float lNormalTol;
 uniform float lNormalPow;
 uniform float lNormalPow;
 
 
+out vec4 OUT_col;
+
 
 
 #ifndef QUALITY
 #ifndef QUALITY
    #define QUALITY 2
    #define QUALITY 2
@@ -152,7 +154,7 @@ void main()
    // Early out if too far away.
    // Early out if too far away.
    if ( depth > 0.99999999 )
    if ( depth > 0.99999999 )
    {
    {
-      OUT_FragColor0 = vec4( 0,0,0,0 );
+      OUT_col = vec4( 0,0,0,0 );
       return;
       return;
    }
    }
 
 
@@ -270,7 +272,7 @@ void main()
    // seems backwards, but it makes it simple to deal with the SSAO
    // seems backwards, but it makes it simple to deal with the SSAO
    // being disabled in the lighting shaders.   
    // being disabled in the lighting shaders.   
    
    
-   OUT_FragColor0 = vec4(occlusion, vec3(0.0));
+   OUT_col = vec4(occlusion, vec3(0.0));
 }
 }
 
 
 
 

+ 3 - 1
Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_PowerTable_P.glsl

@@ -25,8 +25,10 @@
 in vec2 uv0;
 in vec2 uv0;
 #define IN_uv0 uv0
 #define IN_uv0 uv0
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {  
 {  
    float power = pow( max( IN_uv0.x, 0 ), 0.1 );   
    float power = pow( max( IN_uv0.x, 0 ), 0.1 );   
-   OUT_FragColor0 = vec4( power, 0, 0, 1 );
+   OUT_col = vec4( power, 0, 0, 1 );
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/terrain/gl/blendP.glsl

@@ -33,6 +33,8 @@ uniform sampler2D textureMap;
 uniform float texId;
 uniform float texId;
 uniform float layerSize;
 uniform float layerSize;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    vec4 layerSample = round(texture( layerTex, IN_layerCoord ) * 255.0);
    vec4 layerSample = round(texture( layerTex, IN_layerCoord ) * 255.0);
@@ -42,5 +44,5 @@ void main()
    if(blend - 0.0001 < 0.0)
    if(blend - 0.0001 < 0.0)
       discard;
       discard;
 
 
-   OUT_FragColor0 = vec4( texture( textureMap, IN_texCoord ).rgb, blend );
+   OUT_col = vec4( texture( textureMap, IN_texCoord ).rgb, blend );
 }
 }

+ 4 - 2
Templates/Empty/game/shaders/common/water/gl/waterBasicP.glsl

@@ -111,6 +111,8 @@ uniform vec4       rippleMagnitude;
 uniform vec4       specularParams;
 uniform vec4       specularParams;
 uniform mat4     modelMat;
 uniform mat4     modelMat;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Main                                                                        
 // Main                                                                        
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -136,7 +138,7 @@ void main()
    distortPos.xy += bumpNorm.xy * distortAmt;   
    distortPos.xy += bumpNorm.xy * distortAmt;   
  
  
  #ifdef UNDERWATER
  #ifdef UNDERWATER
-   OUT_FragColor0 = hdrEncode( textureProj( refractBuff, distortPos ) );   
+   OUT_col = hdrEncode( textureProj( refractBuff, distortPos ) );   
  #else
  #else
 
 
    vec3 eyeVec = IN_objPos.xyz - eyePos;
    vec3 eyeVec = IN_objPos.xyz - eyePos;
@@ -208,7 +210,7 @@ void main()
 
 
    #endif
    #endif
    
    
-   OUT_FragColor0 = OUT;
+   OUT_col = OUT;
    
    
 #endif   
 #endif   
 }
 }

+ 3 - 1
Templates/Empty/game/shaders/common/water/gl/waterP.glsl

@@ -145,6 +145,8 @@ uniform vec4	      sunColor;
 uniform float        sunBrightness;
 uniform float        sunBrightness;
 uniform float        reflectivity;
 uniform float        reflectivity;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Main                                                                        
 // Main                                                                        
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -390,5 +392,5 @@ void main()
 
 
    //return OUT;
    //return OUT;
    
    
-   OUT_FragColor0 = hdrEncode( OUT );
+   OUT_col = hdrEncode( OUT );
 }
 }

+ 2 - 2
Templates/Full/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl

@@ -24,9 +24,9 @@ uniform sampler2D diffuseMap;
 in vec4 color;
 in vec4 color;
 in vec2 texCoord;
 in vec2 texCoord;
 
 
-out vec4 OUT_FragColor0;
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = vec4(color.rgb, color.a * texture(diffuseMap, texCoord).a);
+   OUT_col = vec4(color.rgb, color.a * texture(diffuseMap, texCoord).a);
 }
 }

+ 2 - 2
Templates/Full/game/shaders/common/fixedFunction/gl/colorP.glsl

@@ -22,9 +22,9 @@
 
 
 in vec4 color;
 in vec4 color;
 
 
-out vec4 OUT_FragColor0;
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = color;
+   OUT_col = color;
 }
 }

+ 2 - 2
Templates/Full/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl

@@ -24,9 +24,9 @@ uniform sampler2D diffuseMap;
 in vec4 color;
 in vec4 color;
 in vec2 texCoord;
 in vec2 texCoord;
 
 
-out vec4 OUT_FragColor0;
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = texture(diffuseMap, texCoord) * color;
+   OUT_col = texture(diffuseMap, texCoord) * color;
 }
 }

+ 2 - 2
Templates/Full/game/shaders/common/fixedFunction/gl/textureP.glsl

@@ -23,9 +23,9 @@
 uniform sampler2D diffuseMap;
 uniform sampler2D diffuseMap;
 in vec2 texCoord;
 in vec2 texCoord;
 
 
-out vec4 OUT_FragColor0;
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = texture(diffuseMap, texCoord);
+   OUT_col = texture(diffuseMap, texCoord);
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/gl/basicCloudsP.glsl

@@ -30,8 +30,10 @@ in vec2 texCoord;
 
 
 uniform sampler2D diffuseMap        ;
 uniform sampler2D diffuseMap        ;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    vec4 col = texture( diffuseMap, IN_texCoord );
    vec4 col = texture( diffuseMap, IN_texCoord );
-   OUT_FragColor0 = hdrEncode( col );
+   OUT_col = hdrEncode( col );
 }
 }

+ 6 - 4
Templates/Full/game/shaders/common/gl/blurP.glsl

@@ -28,10 +28,12 @@ uniform sampler2D diffuseMap;
 
 
 in vec2 texc0, texc1, texc2, texc3;
 in vec2 texc0, texc1, texc2, texc3;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = texture(diffuseMap, texc0) * kernel.x;
-   OUT_FragColor0 += texture(diffuseMap, texc1) * kernel.y;
-   OUT_FragColor0 += texture(diffuseMap, texc2) * kernel.z;
-   OUT_FragColor0 += texture(diffuseMap, texc3) * kernel.w;
+   OUT_col = texture(diffuseMap, texc0) * kernel.x;
+   OUT_col += texture(diffuseMap, texc1) * kernel.y;
+   OUT_col += texture(diffuseMap, texc2) * kernel.z;
+   OUT_col += texture(diffuseMap, texc3) * kernel.w;
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/gl/cloudLayerP.glsl

@@ -47,6 +47,8 @@ uniform float     cloudCoverage;
 uniform vec3      cloudBaseColor;
 uniform vec3      cloudBaseColor;
 uniform float	  cloudExposure;
 uniform float	  cloudExposure;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Globals                                                                        
 // Globals                                                                        
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -141,5 +143,5 @@ void main()
 
 
    cResultColor.a = mix( cResultColor.a, 0.0, 1.0 - pow(IN_worldDist,2.0) );
    cResultColor.a = mix( cResultColor.a, 0.0, 1.0 - pow(IN_worldDist,2.0) );
 
 
-   OUT_FragColor0 = cResultColor;
+   OUT_col = cResultColor;
 }   
 }   

+ 4 - 2
Templates/Full/game/shaders/common/gl/fxFoliageReplicatorP.glsl

@@ -29,12 +29,14 @@ uniform vec4 groundAlpha;
 in vec4 color, groundAlphaCoeff;
 in vec4 color, groundAlphaCoeff;
 in vec2 outTexCoord, alphaLookup;
 in vec2 outTexCoord, alphaLookup;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Main                                                                        
 // Main                                                                        
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 void main()
 void main()
 {
 {
    vec4 alpha = texture(alphaMap, alphaLookup);
    vec4 alpha = texture(alphaMap, alphaLookup);
-   OUT_FragColor0 = color * texture(diffuseMap, outTexCoord);
-   OUT_FragColor0.a = OUT_FragColor0.a * min(alpha, groundAlpha + groundAlphaCoeff.x).x;
+   OUT_col = color * texture(diffuseMap, outTexCoord);
+   OUT_col.a = OUT_col.a * min(alpha, groundAlpha + groundAlphaCoeff.x).x;
 }
 }

+ 0 - 3
Templates/Full/game/shaders/common/gl/hlslCompat.glsl

@@ -100,7 +100,4 @@ mat4 mat4FromRow( float r0c0, float r0c1, float r0c2, float r0c3,
 
 
 #ifdef TORQUE_PIXEL_SHADER
 #ifdef TORQUE_PIXEL_SHADER
 	void clip(float a) { if(a < 0) discard;}
 	void clip(float a) { if(a < 0) discard;}
-    
-   out vec4 OUT_col;
-   #define OUT_FragColor0 OUT_col
 #endif
 #endif

+ 2 - 1
Templates/Full/game/shaders/common/gl/particleCompositeP.glsl

@@ -38,6 +38,7 @@ uniform sampler2D edgeSource;
 uniform vec4 edgeTargetParams;
 uniform vec4 edgeTargetParams;
 #endif
 #endif
 
 
+out vec4 OUT_col;
 
 
 void main()
 void main()
 {  
 {  
@@ -57,5 +58,5 @@ void main()
 #endif
 #endif
 	
 	
 	// Sample offscreen target and return
 	// Sample offscreen target and return
-   OUT_FragColor0 = texture( colorSource, uvScene.xy );
+   OUT_col = texture( colorSource, uvScene.xy );
 }
 }

+ 4 - 2
Templates/Full/game/shaders/common/gl/particlesP.glsl

@@ -78,6 +78,8 @@ vec4 lmSample( vec3 nrm )
 uniform float alphaFactor;
 uniform float alphaFactor;
 uniform float alphaScale;
 uniform float alphaScale;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    float softBlend = 1;
    float softBlend = 1;
@@ -100,12 +102,12 @@ void main()
 	   
 	   
    vec4 diffuse = texture( diffuseMap, IN_uv0 );
    vec4 diffuse = texture( diffuseMap, IN_uv0 );
    
    
-   //OUT_FragColor0 = vec4( lmSample(vec3(0, 0, -1)).rgb, IN_color.a * diffuse.a * softBlend * alphaScale);
+   //OUT_col = vec4( lmSample(vec3(0, 0, -1)).rgb, IN_color.a * diffuse.a * softBlend * alphaScale);
    
    
    // Scale output color by the alpha factor (turn LerpAlpha into pre-multiplied alpha)
    // Scale output color by the alpha factor (turn LerpAlpha into pre-multiplied alpha)
    vec3 colorScale = ( alphaFactor < 0.0 ? IN_color.rgb * diffuse.rgb : vec3( alphaFactor > 0.0 ? IN_color.a * diffuse.a * alphaFactor * softBlend : softBlend ) );
    vec3 colorScale = ( alphaFactor < 0.0 ? IN_color.rgb * diffuse.rgb : vec3( alphaFactor > 0.0 ? IN_color.a * diffuse.a * alphaFactor * softBlend : softBlend ) );
    
    
-   OUT_FragColor0 = hdrEncode( vec4( IN_color.rgb * diffuse.rgb * colorScale,
+   OUT_col = hdrEncode( vec4( IN_color.rgb * diffuse.rgb * colorScale,
                   IN_color.a * diffuse.a * softBlend * alphaScale ) );
                   IN_color.a * diffuse.a * softBlend * alphaScale ) );
 }
 }
 
 

+ 3 - 1
Templates/Full/game/shaders/common/gl/planarReflectBumpP.glsl

@@ -29,6 +29,8 @@ uniform vec4 shadeColor;
 in vec2 TEX0;
 in vec2 TEX0;
 in vec4 TEX1;
 in vec4 TEX1;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Fade edges of axis for texcoord passed in
 // Fade edges of axis for texcoord passed in
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -64,5 +66,5 @@ void main()
    vec4 diffuseColor = texture( diffuseMap, TEX0 );
    vec4 diffuseColor = texture( diffuseMap, TEX0 );
    vec4 reflectColor = textureProj( refractMap, texIndex );
    vec4 reflectColor = textureProj( refractMap, texIndex );
 
 
-   OUT_FragColor0 = diffuseColor + reflectColor * diffuseColor.a;
+   OUT_col = diffuseColor + reflectColor * diffuseColor.a;
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/gl/planarReflectP.glsl

@@ -29,6 +29,8 @@ uniform vec4 shadeColor;
 in vec2 TEX0;
 in vec2 TEX0;
 in vec4 TEX1;
 in vec4 TEX1;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Main                                                                        
 // Main                                                                        
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -37,5 +39,5 @@ void main()
    vec4 diffuseColor = texture( diffuseMap, TEX0 );
    vec4 diffuseColor = texture( diffuseMap, TEX0 );
    vec4 reflectColor = textureProj( refractMap, TEX1 );
    vec4 reflectColor = textureProj( refractMap, TEX1 );
 
 
-   OUT_FragColor0 = diffuseColor + reflectColor * diffuseColor.a;
+   OUT_col = diffuseColor + reflectColor * diffuseColor.a;
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/gl/precipP.glsl

@@ -28,10 +28,12 @@ uniform sampler2D diffuseMap;
 in vec4 color;
 in vec4 color;
 in vec2 texCoord;
 in vec2 texCoord;
 
 
+out vec4 OUT_col;
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Main                                                                        
 // Main                                                                        
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 void main()
 void main()
 {
 {
-   OUT_FragColor0 = texture(diffuseMap, texCoord) * color;
+   OUT_col = texture(diffuseMap, texCoord) * color;
 }
 }

+ 2 - 2
Templates/Full/game/shaders/common/gl/projectedShadowP.glsl

@@ -24,7 +24,7 @@ in vec2 texCoord;
 in vec4 color;
 in vec4 color;
 in float fade;
 in float fade;
 
 
-out vec4 OUT_FragColor0;
+out vec4 OUT_col;
 
 
 uniform sampler2D inputTex;
 uniform sampler2D inputTex;
 uniform vec4 ambient;
 uniform vec4 ambient;
@@ -33,5 +33,5 @@ uniform vec4 ambient;
 void main()
 void main()
 {   
 {   
 	float shadow = texture( inputTex, texCoord ).a * color.a;           
 	float shadow = texture( inputTex, texCoord ).a * color.a;           
-    OUT_FragColor0 = ( ambient * shadow ) + ( 1 - shadow );
+    OUT_col = ( ambient * shadow ) + ( 1 - shadow );
 }
 }

+ 5 - 3
Templates/Full/game/shaders/common/gl/scatterSkyP.glsl

@@ -43,6 +43,8 @@ uniform float useCubemap;
 uniform vec3 lightDir;
 uniform vec3 lightDir;
 uniform vec3 sunDir;
 uniform vec3 sunDir;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 { 
 { 
 
 
@@ -62,7 +64,7 @@ void main()
 
 
    float fac = dot( normalize( pos ), sunDir );
    float fac = dot( normalize( pos ), sunDir );
    fac = max( nightInterpAndExposure.y, pow( clamp( fac, 0.0, 1.0 ), 2 ) );
    fac = max( nightInterpAndExposure.y, pow( clamp( fac, 0.0, 1.0 ), 2 ) );
-   OUT_FragColor0 = mix( color, nightSkyColor, nightInterpAndExposure.y );
+   OUT_col = mix( color, nightSkyColor, nightInterpAndExposure.y );
    
    
    // Clip based on the camera-relative
    // Clip based on the camera-relative
    // z position of the vertex, passed through
    // z position of the vertex, passed through
@@ -70,6 +72,6 @@ void main()
    if(zPosition < 0.0)
    if(zPosition < 0.0)
       discard;
       discard;
 
 
-   OUT_FragColor0.a = 1;
-   OUT_FragColor0 = hdrEncode( OUT_FragColor0 );
+   OUT_col.a = 1;
+   OUT_col = hdrEncode( OUT_col );
 }
 }

+ 1 - 1
Templates/Full/game/shaders/common/gl/torque.glsl

@@ -267,6 +267,6 @@ void fizzle(vec2 vpos, float visibility)
 /// @param condition This should be a bvec[2-4].  If any items is false, condition is considered to fail.
 /// @param condition This should be a bvec[2-4].  If any items is false, condition is considered to fail.
 /// @param color The color that should be outputted if the condition fails.
 /// @param color The color that should be outputted if the condition fails.
 /// @note This macro will only work in the void main() method of a pixel shader.
 /// @note This macro will only work in the void main() method of a pixel shader.
-#define assert(condition, color) { if(!any(condition)) { OUT_FragColor0 = color; return; } }
+#define assert(condition, color) { if(!any(condition)) { OUT_col = color; return; } }
 
 
 #endif // _TORQUE_GLSL_
 #endif // _TORQUE_GLSL_

+ 4 - 2
Templates/Full/game/shaders/common/gl/wavesP.glsl

@@ -33,6 +33,8 @@ in vec4 outLightVec;
 in vec3 outPos;
 in vec3 outPos;
 in vec3 outEyePos;
 in vec3 outEyePos;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    vec2 texOffset;
    vec2 texOffset;
@@ -45,11 +47,11 @@ void main()
    vec4 bumpNorm = texture(bumpMap, texOffset) * 2.0 - 1.0;
    vec4 bumpNorm = texture(bumpMap, texOffset) * 2.0 - 1.0;
    vec4 diffuse = texture(diffMap, texOffset);
    vec4 diffuse = texture(diffMap, texOffset);
    
    
-   OUT_FragColor0 = diffuse * (clamp(dot(outLightVec.xyz, bumpNorm.xyz), 0.0, 1.0) + ambient);
+   OUT_col = diffuse * (clamp(dot(outLightVec.xyz, bumpNorm.xyz), 0.0, 1.0) + ambient);
    
    
    vec3 eyeVec = normalize(outEyePos - outPos);
    vec3 eyeVec = normalize(outEyePos - outPos);
    vec3 halfAng = normalize(eyeVec + outLightVec.xyz);
    vec3 halfAng = normalize(eyeVec + outLightVec.xyz);
    float specular = clamp(dot(bumpNorm.xyz, halfAng), 0.0, 1.0) * outLightVec.w;
    float specular = clamp(dot(bumpNorm.xyz, halfAng), 0.0, 1.0) * outLightVec.w;
    specular = pow(specular, specularPower);
    specular = pow(specular, specularPower);
-   OUT_FragColor0 += specularColor * specular;
+   OUT_col += specularColor * specular;
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl

@@ -27,8 +27,10 @@ in vec2 uv0;
 uniform sampler2D prepassBuffer;
 uniform sampler2D prepassBuffer;
 uniform sampler1D depthViz;
 uniform sampler1D depthViz;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    float depth = prepassUncondition( prepassBuffer, uv0 ).w;
    float depth = prepassUncondition( prepassBuffer, uv0 ).w;
-   OUT_FragColor0 = vec4( texture( depthViz, depth ).rgb, 1.0 );
+   OUT_col = vec4( texture( depthViz, depth ).rgb, 1.0 );
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl

@@ -26,10 +26,12 @@
 in vec2 uv0;
 in vec2 uv0;
 uniform sampler2D lightInfoBuffer;
 uniform sampler2D lightInfoBuffer;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {   
 {   
    vec3 lightcolor;   
    vec3 lightcolor;   
    float nl_Att, specular;   
    float nl_Att, specular;   
    lightinfoUncondition( texture( lightInfoBuffer, uv0 ), lightcolor, nl_Att, specular );   
    lightinfoUncondition( texture( lightInfoBuffer, uv0 ), lightcolor, nl_Att, specular );   
-   OUT_FragColor0 = vec4( lightcolor, 1.0 ); 
+   OUT_col = vec4( lightcolor, 1.0 ); 
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl

@@ -26,10 +26,12 @@
 in vec2 uv0;
 in vec2 uv0;
 uniform sampler2D lightInfoBuffer;
 uniform sampler2D lightInfoBuffer;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {   
 {   
    vec3 lightcolor;   
    vec3 lightcolor;   
    float nl_Att, specular;   
    float nl_Att, specular;   
    lightinfoUncondition( texture( lightInfoBuffer, uv0 ), lightcolor, nl_Att, specular );   
    lightinfoUncondition( texture( lightInfoBuffer, uv0 ), lightcolor, nl_Att, specular );   
-   OUT_FragColor0 = vec4( specular, specular, specular, 1.0 );
+   OUT_col = vec4( specular, specular, specular, 1.0 );
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl

@@ -26,8 +26,10 @@
 in vec2 uv0;
 in vec2 uv0;
 uniform sampler2D prepassBuffer;
 uniform sampler2D prepassBuffer;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {   
 {   
    vec3 normal = prepassUncondition( prepassBuffer, uv0 ).xyz;
    vec3 normal = prepassUncondition( prepassBuffer, uv0 ).xyz;
-   OUT_FragColor0 = vec4( ( normal + 1.0 ) * 0.5, 1.0 );
+   OUT_col = vec4( ( normal + 1.0 ) * 0.5, 1.0 );
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl

@@ -25,8 +25,10 @@ in vec2 uv0;
 uniform sampler2D shadowMap;
 uniform sampler2D shadowMap;
 uniform sampler1D depthViz;
 uniform sampler1D depthViz;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    float depth = saturate( texture( shadowMap, uv0 ).r );
    float depth = saturate( texture( shadowMap, uv0 ).r );
-   OUT_FragColor0 = vec4( texture( depthViz, depth ).rgb, 1 );
+   OUT_col = vec4( texture( depthViz, depth ).rgb, 1 );
 }
 }

+ 3 - 2
Templates/Full/game/shaders/common/lighting/advanced/gl/pointLightP.glsl

@@ -121,7 +121,8 @@ uniform vec4 vsFarPlane;
 uniform mat3 viewToLightProj;
 uniform mat3 viewToLightProj;
 uniform vec4 lightParams;
 uniform vec4 lightParams;
 uniform float shadowSoftness;
 uniform float shadowSoftness;
-			   
+
+out vec4 OUT_col;
 
 
 void main()               
 void main()               
 {   
 {   
@@ -229,5 +230,5 @@ void main()
       addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
       addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
    }
    }
 
 
-   OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );
+   OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/lighting/advanced/gl/spotLightP.glsl

@@ -63,6 +63,8 @@ uniform mat4 viewToLightProj;
 uniform vec4 lightParams;
 uniform vec4 lightParams;
 uniform float shadowSoftness;
 uniform float shadowSoftness;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {   
 {   
    // Compute scene UV
    // Compute scene UV
@@ -162,5 +164,5 @@ void main()
       addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
       addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
    }
    }
 
 
-   OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );
+   OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl

@@ -62,6 +62,8 @@ uniform vec4 farPlaneScalePSSM;
 uniform vec4 overDarkPSSM;
 uniform vec4 overDarkPSSM;
 uniform float shadowSoftness;
 uniform float shadowSoftness;
 
 
+out vec4 OUT_col;
+
 void main()             
 void main()             
 {
 {
    // Sample/unpack the normal/z data
    // Sample/unpack the normal/z data
@@ -227,6 +229,6 @@ void main()
       lightColorOut = debugColor;
       lightColorOut = debugColor;
    #endif
    #endif
    
    
-   OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );  
+   OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult );  
    
    
 }
 }

+ 5 - 5
Templates/Full/game/shaders/common/lighting/basic/gl/shadowFilterP.glsl

@@ -31,16 +31,16 @@ uniform vec2 oneOverTargetSize;
 const float offset[3] = float[]( 0.0, 1.3846153846, 3.2307692308 );
 const float offset[3] = float[]( 0.0, 1.3846153846, 3.2307692308 );
 const float weight[3] = float[]( 0.2270270270, 0.3162162162, 0.0702702703 );
 const float weight[3] = float[]( 0.2270270270, 0.3162162162, 0.0702702703 );
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
-   vec4 OUT = texture( diffuseMap, uv ) * weight[0];
+   OUT_col = texture( diffuseMap, uv ) * weight[0];
    
    
    for ( int i=1; i < 3; i++ )
    for ( int i=1; i < 3; i++ )
    {
    {
       vec2 _sample = (BLUR_DIR * offset[i]) * oneOverTargetSize;
       vec2 _sample = (BLUR_DIR * offset[i]) * oneOverTargetSize;
-      OUT += texture( diffuseMap, uv + _sample ) * weight[i];  
-      OUT += texture( diffuseMap, uv - _sample ) * weight[i];  
+      OUT_col += texture( diffuseMap, uv + _sample ) * weight[i];  
+      OUT_col += texture( diffuseMap, uv - _sample ) * weight[i];  
    }
    }
-
-   OUT_FragColor0 = OUT;
 }
 }

+ 3 - 1
Templates/Full/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl

@@ -28,6 +28,8 @@ uniform vec2 blurDimension;
 
 
 in vec2 tex0;
 in vec2 tex0;
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {
 {
    // Preshader
    // Preshader
@@ -43,5 +45,5 @@ void main()
       accum += texture(diffuseMap0, BaseTexCoord + float(i) * SampleOffset);
       accum += texture(diffuseMap0, BaseTexCoord + float(i) * SampleOffset);
    }
    }
    accum /= blurSamples;
    accum /= blurSamples;
-   OUT_FragColor0 = accum;
+   OUT_col = accum;
 }
 }

+ 5 - 3
Templates/Full/game/shaders/common/postFx/caustics/gl/causticsP.glsl

@@ -34,6 +34,8 @@ uniform sampler2D causticsTex0;
 uniform sampler2D causticsTex1;
 uniform sampler2D causticsTex1;
 uniform vec2 targetSize;
 uniform vec2 targetSize;
 
 
+out vec4 OUT_col;
+
 float distanceToPlane(vec4 plane, vec3 pos)
 float distanceToPlane(vec4 plane, vec3 pos)
 {
 {
    return (plane.x * pos.x + plane.y * pos.y + plane.z * pos.z) + plane.w;
    return (plane.x * pos.x + plane.y * pos.y + plane.z * pos.z) + plane.w;
@@ -48,7 +50,7 @@ void main()
    float depth = prePass.w;   
    float depth = prePass.w;   
    if(depth > 0.9999)
    if(depth > 0.9999)
    {
    {
-      OUT_FragColor0 = vec4(0,0,0,0);
+      OUT_col = vec4(0,0,0,0);
       return;
       return;
    }
    }
    
    
@@ -59,7 +61,7 @@ void main()
    float waterDepth = -distanceToPlane(waterFogPlane, pos);
    float waterDepth = -distanceToPlane(waterFogPlane, pos);
    if(waterDepth < 0)
    if(waterDepth < 0)
    {
    {
-      OUT_FragColor0 = vec4(0,0,0,0);
+      OUT_col = vec4(0,0,0,0);
       return;
       return;
    }
    }
    waterDepth = saturate(waterDepth);
    waterDepth = saturate(waterDepth);
@@ -81,5 +83,5 @@ void main()
    //float waterDepth = 1 - saturate(pos.z + waterFogPlane.w + 1);
    //float waterDepth = 1 - saturate(pos.z + waterFogPlane.w + 1);
    caustics *= saturate(prePass.z) * pow(1-depth, 64) * waterDepth; 
    caustics *= saturate(prePass.z) * pow(1-depth, 64) * waterDepth; 
       
       
-   OUT_FragColor0 = caustics;   
+   OUT_col = caustics;   
 }
 }

+ 6 - 4
Templates/Full/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl

@@ -27,6 +27,8 @@
 uniform sampler2D shrunkSampler;  // Output of DofDownsample()  
 uniform sampler2D shrunkSampler;  // Output of DofDownsample()  
 uniform sampler2D blurredSampler; // Blurred version of the shrunk sampler  
 uniform sampler2D blurredSampler; // Blurred version of the shrunk sampler  
 
 
+out vec4 OUT_col;
+
 // This is the pixel shader function that calculates the actual  
 // This is the pixel shader function that calculates the actual  
 // value used for the near circle of confusion.  
 // value used for the near circle of confusion.  
 // "texCoords" are 0 at the bottom left pixel and 1 at the top right.  
 // "texCoords" are 0 at the bottom left pixel and 1 at the top right.  
@@ -46,8 +48,8 @@ void main()
    coc = 2 * max( blurred.a, shrunk.a ) - shrunk.a;  
    coc = 2 * max( blurred.a, shrunk.a ) - shrunk.a;  
    
    
    
    
-   //OUT_FragColor0 = vec4( coc.rrr, 1.0 );
-   //OUT_FragColor0 = vec4( color, 1.0 );
-   OUT_FragColor0 = vec4( color, coc );  
-   //OUT_FragColor0 = vec4( 1.0, 0.0, 1.0, 1.0 );
+   //OUT_col = vec4( coc.rrr, 1.0 );
+   //OUT_col = vec4( color, 1.0 );
+   OUT_col = vec4( color, coc );  
+   //OUT_col = vec4( 1.0, 0.0, 1.0, 1.0 );
 }
 }

+ 6 - 4
Templates/Full/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl

@@ -47,6 +47,8 @@ in vec2 tcDepth2;
 in vec2 tcDepth3;
 in vec2 tcDepth3;
 #define IN_tcDepth3 tcDepth3
 #define IN_tcDepth3 tcDepth3
 
 
+out vec4 OUT_col;
+
 void main()
 void main()
 {  
 {  
    //return vec4( 1.0, 0.0, 1.0, 1.0 );
    //return vec4( 1.0, 0.0, 1.0, 1.0 );
@@ -131,8 +133,8 @@ void main()
    
    
    maxCoc = max( max( coc[0], coc[1] ), max( coc[2], coc[3] ) );  
    maxCoc = max( max( coc[0], coc[1] ), max( coc[2], coc[3] ) );  
    
    
-   //OUT_FragColor0 = half4( 1.0, 0.0, 1.0, 1.0 );
-   OUT_FragColor0 = half4( color, maxCoc );  
-   //OUT_FragColor0 = half4( color, 1.0f );
-   //OUT_FragColor0 = half4( maxCoc.rrr, 1.0 );
+   //OUT_col = half4( 1.0, 0.0, 1.0, 1.0 );
+   OUT_col = half4( color, maxCoc );  
+   //OUT_col = half4( color, 1.0f );
+   //OUT_col = half4( maxCoc.rrr, 1.0 );
 }  
 }  

+ 3 - 1
Templates/Full/game/shaders/common/postFx/dof/gl/DOF_Final_P.glsl

@@ -41,6 +41,8 @@ uniform float maxFarCoC;
 //static vec4 dofLerpBias = vec4( 1.0, (1.0 - d2) / d1, 1.0 / d2, (d2 - 1.0) / d2 );
 //static vec4 dofLerpBias = vec4( 1.0, (1.0 - d2) / d1, 1.0 / d2, (d2 - 1.0) / d2 );
 //static vec3 dofEqFar = vec3( 2.0, 0.0, 1.0 ); 
 //static vec3 dofEqFar = vec3( 2.0, 0.0, 1.0 ); 
 
 
+out vec4 OUT_col;
+
 vec4 tex2Doffset( sampler2D s, vec2 tc, vec2 offset )  
 vec4 tex2Doffset( sampler2D s, vec2 tc, vec2 offset )  
 {  
 {  
    return texture( s, tc + offset * oneOverTargetSize );  
    return texture( s, tc + offset * oneOverTargetSize );  
@@ -141,5 +143,5 @@ void main()
    //return half4(nearCoc.rrr,1);
    //return half4(nearCoc.rrr,1);
    
    
    //return half4( 1,0,1,0 );
    //return half4( 1,0,1,0 );
-   OUT_FragColor0 = InterpolateDof( small, med.rgb, large, coc );  
+   OUT_col = InterpolateDof( small, med.rgb, large, coc );  
 }  
 }  

Some files were not shown because too many files changed in this diff