From ed0febea3947ec084afa88063ffc25c3e31db6cb Mon Sep 17 00:00:00 2001 From: LuisAntonRebollo Date: Sun, 30 Nov 2014 22:56:30 +0100 Subject: [PATCH] Clean GLSL fragment shader out. --- .../source/shaderGen/GLSL/shaderGenGLSL.cpp | 2 +- .../fixedFunction/gl/addColorTextureP.glsl | 4 +-- .../common/fixedFunction/gl/colorP.glsl | 4 +-- .../fixedFunction/gl/modColorTextureP.glsl | 4 +-- .../common/fixedFunction/gl/textureP.glsl | 4 +-- .../game/shaders/common/gl/basicCloudsP.glsl | 4 ++- .../Empty/game/shaders/common/gl/blurP.glsl | 10 ++++--- .../game/shaders/common/gl/cloudLayerP.glsl | 4 ++- .../common/gl/fxFoliageReplicatorP.glsl | 6 +++-- .../game/shaders/common/gl/hlslCompat.glsl | 3 --- .../shaders/common/gl/particleCompositeP.glsl | 3 ++- .../game/shaders/common/gl/particlesP.glsl | 6 +++-- .../shaders/common/gl/planarReflectBumpP.glsl | 4 ++- .../shaders/common/gl/planarReflectP.glsl | 4 ++- .../Empty/game/shaders/common/gl/precipP.glsl | 4 ++- .../shaders/common/gl/projectedShadowP.glsl | 4 +-- .../game/shaders/common/gl/scatterSkyP.glsl | 8 +++--- .../Empty/game/shaders/common/gl/torque.glsl | 2 +- .../Empty/game/shaders/common/gl/wavesP.glsl | 6 +++-- .../advanced/gl/dbgDepthVisualizeP.glsl | 4 ++- .../advanced/gl/dbgLightColorVisualizeP.glsl | 4 ++- .../gl/dbgLightSpecularVisualizeP.glsl | 4 ++- .../advanced/gl/dbgNormalVisualizeP.glsl | 4 ++- .../advanced/gl/dbgShadowVisualizeP.glsl | 4 ++- .../lighting/advanced/gl/pointLightP.glsl | 3 ++- .../lighting/advanced/gl/spotLightP.glsl | 4 ++- .../lighting/advanced/gl/vectorLightP.glsl | 4 ++- .../lighting/basic/gl/shadowFilterP.glsl | 10 +++---- .../lighting/shadowMap/gl/boxFilterP.glsl | 4 ++- .../common/postFx/caustics/gl/causticsP.glsl | 8 +++--- .../common/postFx/dof/gl/DOF_CalcCoC_P.glsl | 12 +++++---- .../postFx/dof/gl/DOF_DownSample_P.glsl | 10 ++++--- .../common/postFx/dof/gl/DOF_Final_P.glsl | 4 ++- .../common/postFx/dof/gl/DOF_Gausian_P.glsl | 22 +++++++-------- .../common/postFx/dof/gl/DOF_SmallBlur_P.glsl | 4 ++- .../postFx/edgeaa/gl/dbgEdgeDisplayP.glsl | 4 ++- .../common/postFx/edgeaa/gl/edgeAAP.glsl | 4 ++- .../common/postFx/edgeaa/gl/edgeDetectP.glsl | 4 ++- .../shaders/common/postFx/fxaa/gl/fxaaP.glsl | 4 ++- .../common/postFx/gl/chromaticLens.glsl | 4 ++- .../game/shaders/common/postFx/gl/flashP.glsl | 4 ++- .../game/shaders/common/postFx/gl/fogP.glsl | 4 ++- .../game/shaders/common/postFx/gl/gammaP.glsl | 4 ++- .../shaders/common/postFx/gl/glowBlurP.glsl | 27 ++++++++++--------- .../shaders/common/postFx/gl/motionBlurP.glsl | 4 ++- .../shaders/common/postFx/gl/passthruP.glsl | 4 ++- .../shaders/common/postFx/gl/turbulenceP.glsl | 4 ++- .../common/postFx/gl/underwaterFogP.glsl | 4 ++- .../postFx/hdr/gl/bloomGaussBlurHP.glsl | 4 ++- .../postFx/hdr/gl/bloomGaussBlurVP.glsl | 4 ++- .../postFx/hdr/gl/brightPassFilterP.glsl | 4 ++- .../postFx/hdr/gl/calculateAdaptedLumP.glsl | 4 ++- .../common/postFx/hdr/gl/downScale4x4P.glsl | 4 ++- .../postFx/hdr/gl/finalPassCombineP.glsl | 4 ++- .../common/postFx/hdr/gl/luminanceVisP.glsl | 4 ++- .../postFx/hdr/gl/sampleLumInitialP.glsl | 4 ++- .../postFx/hdr/gl/sampleLumIterativeP.glsl | 3 ++- .../postFx/lightRay/gl/lightRayOccludeP.glsl | 3 ++- .../common/postFx/lightRay/gl/lightRayP.glsl | 6 +++-- .../mlaa/gl/blendWeightCalculationP.glsl | 4 ++- .../common/postFx/mlaa/gl/edgeDetectionP.glsl | 4 ++- .../postFx/mlaa/gl/neighborhoodBlendingP.glsl | 3 ++- .../common/postFx/ssao/gl/SSAO_Blur_P.glsl | 3 ++- .../shaders/common/postFx/ssao/gl/SSAO_P.glsl | 6 +++-- .../postFx/ssao/gl/SSAO_PowerTable_P.glsl | 4 ++- .../shaders/common/terrain/gl/blendP.glsl | 4 ++- .../shaders/common/water/gl/waterBasicP.glsl | 6 +++-- .../game/shaders/common/water/gl/waterP.glsl | 4 ++- .../fixedFunction/gl/addColorTextureP.glsl | 4 +-- .../common/fixedFunction/gl/colorP.glsl | 4 +-- .../fixedFunction/gl/modColorTextureP.glsl | 4 +-- .../common/fixedFunction/gl/textureP.glsl | 4 +-- .../game/shaders/common/gl/basicCloudsP.glsl | 4 ++- .../Full/game/shaders/common/gl/blurP.glsl | 10 ++++--- .../game/shaders/common/gl/cloudLayerP.glsl | 4 ++- .../common/gl/fxFoliageReplicatorP.glsl | 6 +++-- .../game/shaders/common/gl/hlslCompat.glsl | 3 --- .../shaders/common/gl/particleCompositeP.glsl | 3 ++- .../game/shaders/common/gl/particlesP.glsl | 6 +++-- .../shaders/common/gl/planarReflectBumpP.glsl | 4 ++- .../shaders/common/gl/planarReflectP.glsl | 4 ++- .../Full/game/shaders/common/gl/precipP.glsl | 4 ++- .../shaders/common/gl/projectedShadowP.glsl | 4 +-- .../game/shaders/common/gl/scatterSkyP.glsl | 8 +++--- .../Full/game/shaders/common/gl/torque.glsl | 2 +- .../Full/game/shaders/common/gl/wavesP.glsl | 6 +++-- .../advanced/gl/dbgDepthVisualizeP.glsl | 4 ++- .../advanced/gl/dbgLightColorVisualizeP.glsl | 4 ++- .../gl/dbgLightSpecularVisualizeP.glsl | 4 ++- .../advanced/gl/dbgNormalVisualizeP.glsl | 4 ++- .../advanced/gl/dbgShadowVisualizeP.glsl | 4 ++- .../lighting/advanced/gl/pointLightP.glsl | 5 ++-- .../lighting/advanced/gl/spotLightP.glsl | 4 ++- .../lighting/advanced/gl/vectorLightP.glsl | 4 ++- .../lighting/basic/gl/shadowFilterP.glsl | 10 +++---- .../lighting/shadowMap/gl/boxFilterP.glsl | 4 ++- .../common/postFx/caustics/gl/causticsP.glsl | 8 +++--- .../common/postFx/dof/gl/DOF_CalcCoC_P.glsl | 10 ++++--- .../postFx/dof/gl/DOF_DownSample_P.glsl | 10 ++++--- .../common/postFx/dof/gl/DOF_Final_P.glsl | 4 ++- .../common/postFx/dof/gl/DOF_Gausian_P.glsl | 22 +++++++-------- .../common/postFx/dof/gl/DOF_SmallBlur_P.glsl | 4 ++- .../postFx/edgeaa/gl/dbgEdgeDisplayP.glsl | 4 ++- .../common/postFx/edgeaa/gl/edgeAAP.glsl | 4 ++- .../common/postFx/edgeaa/gl/edgeDetectP.glsl | 4 ++- .../shaders/common/postFx/fxaa/gl/fxaaP.glsl | 4 ++- .../common/postFx/gl/chromaticLens.glsl | 4 ++- .../game/shaders/common/postFx/gl/flashP.glsl | 4 ++- .../game/shaders/common/postFx/gl/fogP.glsl | 4 ++- .../game/shaders/common/postFx/gl/gammaP.glsl | 4 ++- .../shaders/common/postFx/gl/glowBlurP.glsl | 23 ++++++++-------- .../shaders/common/postFx/gl/motionBlurP.glsl | 4 ++- .../shaders/common/postFx/gl/passthruP.glsl | 4 ++- .../shaders/common/postFx/gl/turbulenceP.glsl | 4 ++- .../common/postFx/gl/underwaterFogP.glsl | 4 ++- .../postFx/hdr/gl/bloomGaussBlurHP.glsl | 4 ++- .../postFx/hdr/gl/bloomGaussBlurVP.glsl | 4 ++- .../postFx/hdr/gl/brightPassFilterP.glsl | 4 ++- .../postFx/hdr/gl/calculateAdaptedLumP.glsl | 4 ++- .../common/postFx/hdr/gl/downScale4x4P.glsl | 4 ++- .../postFx/hdr/gl/finalPassCombineP.glsl | 4 ++- .../common/postFx/hdr/gl/luminanceVisP.glsl | 4 ++- .../postFx/hdr/gl/sampleLumInitialP.glsl | 4 ++- .../postFx/hdr/gl/sampleLumIterativeP.glsl | 3 ++- .../postFx/lightRay/gl/lightRayOccludeP.glsl | 3 ++- .../common/postFx/lightRay/gl/lightRayP.glsl | 6 +++-- .../mlaa/gl/blendWeightCalculationP.glsl | 4 ++- .../common/postFx/mlaa/gl/edgeDetectionP.glsl | 4 ++- .../postFx/mlaa/gl/neighborhoodBlendingP.glsl | 3 ++- .../common/postFx/ssao/gl/SSAO_Blur_P.glsl | 3 ++- .../shaders/common/postFx/ssao/gl/SSAO_P.glsl | 6 +++-- .../postFx/ssao/gl/SSAO_PowerTable_P.glsl | 4 ++- .../shaders/common/terrain/gl/blendP.glsl | 4 ++- .../shaders/common/water/gl/waterBasicP.glsl | 6 +++-- .../game/shaders/common/water/gl/waterP.glsl | 4 ++- 135 files changed, 451 insertions(+), 239 deletions(-) diff --git a/Engine/source/shaderGen/GLSL/shaderGenGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderGenGLSL.cpp index 907e3541c..d89682951 100644 --- a/Engine/source/shaderGen/GLSL/shaderGenGLSL.cpp +++ b/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("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++ ) { if( numMRTs & 1 << i ) diff --git a/Templates/Empty/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl b/Templates/Empty/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl index 09ad48cef..b9a10adf3 100644 --- a/Templates/Empty/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl +++ b/Templates/Empty/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl @@ -24,9 +24,9 @@ uniform sampler2D diffuseMap; in vec4 color; in vec2 texCoord; -out vec4 OUT_FragColor0; +out vec4 OUT_col; void main() { - OUT_FragColor0 = vec4(color.rgb, color.a * texture(diffuseMap, texCoord).a); + OUT_col = vec4(color.rgb, color.a * texture(diffuseMap, texCoord).a); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/fixedFunction/gl/colorP.glsl b/Templates/Empty/game/shaders/common/fixedFunction/gl/colorP.glsl index 792ee0b5a..f9dfc3d4f 100644 --- a/Templates/Empty/game/shaders/common/fixedFunction/gl/colorP.glsl +++ b/Templates/Empty/game/shaders/common/fixedFunction/gl/colorP.glsl @@ -22,9 +22,9 @@ in vec4 color; -out vec4 OUT_FragColor0; +out vec4 OUT_col; void main() { - OUT_FragColor0 = color; + OUT_col = color; } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl b/Templates/Empty/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl index c2370ee1e..c24b9db12 100644 --- a/Templates/Empty/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl +++ b/Templates/Empty/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl @@ -24,9 +24,9 @@ uniform sampler2D diffuseMap; in vec4 color; in vec2 texCoord; -out vec4 OUT_FragColor0; +out vec4 OUT_col; void main() { - OUT_FragColor0 = texture(diffuseMap, texCoord) * color; + OUT_col = texture(diffuseMap, texCoord) * color; } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/fixedFunction/gl/textureP.glsl b/Templates/Empty/game/shaders/common/fixedFunction/gl/textureP.glsl index 78b0326ba..50cef4bda 100644 --- a/Templates/Empty/game/shaders/common/fixedFunction/gl/textureP.glsl +++ b/Templates/Empty/game/shaders/common/fixedFunction/gl/textureP.glsl @@ -23,9 +23,9 @@ uniform sampler2D diffuseMap; in vec2 texCoord; -out vec4 OUT_FragColor0; +out vec4 OUT_col; void main() { - OUT_FragColor0 = texture(diffuseMap, texCoord); + OUT_col = texture(diffuseMap, texCoord); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/gl/basicCloudsP.glsl b/Templates/Empty/game/shaders/common/gl/basicCloudsP.glsl index ba5801b0f..5b3f50519 100644 --- a/Templates/Empty/game/shaders/common/gl/basicCloudsP.glsl +++ b/Templates/Empty/game/shaders/common/gl/basicCloudsP.glsl @@ -30,8 +30,10 @@ in vec2 texCoord; uniform sampler2D diffuseMap ; +out vec4 OUT_col; + void main() { vec4 col = texture( diffuseMap, IN_texCoord ); - OUT_FragColor0 = hdrEncode( col ); + OUT_col = hdrEncode( col ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/gl/blurP.glsl b/Templates/Empty/game/shaders/common/gl/blurP.glsl index 5c37ebc6b..a27538762 100644 --- a/Templates/Empty/game/shaders/common/gl/blurP.glsl +++ b/Templates/Empty/game/shaders/common/gl/blurP.glsl @@ -28,10 +28,12 @@ uniform sampler2D diffuseMap; in vec2 texc0, texc1, texc2, texc3; +out vec4 OUT_col; + 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; } diff --git a/Templates/Empty/game/shaders/common/gl/cloudLayerP.glsl b/Templates/Empty/game/shaders/common/gl/cloudLayerP.glsl index da3996d58..1ab5946f7 100644 --- a/Templates/Empty/game/shaders/common/gl/cloudLayerP.glsl +++ b/Templates/Empty/game/shaders/common/gl/cloudLayerP.glsl @@ -47,6 +47,8 @@ uniform float cloudCoverage; uniform vec3 cloudBaseColor; uniform float cloudExposure; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Globals //----------------------------------------------------------------------------- @@ -141,5 +143,5 @@ void main() cResultColor.a = mix( cResultColor.a, 0.0, 1.0 - pow(IN_worldDist,2.0) ); - OUT_FragColor0 = cResultColor; + OUT_col = cResultColor; } diff --git a/Templates/Empty/game/shaders/common/gl/fxFoliageReplicatorP.glsl b/Templates/Empty/game/shaders/common/gl/fxFoliageReplicatorP.glsl index fb5abb91e..b4d591486 100644 --- a/Templates/Empty/game/shaders/common/gl/fxFoliageReplicatorP.glsl +++ b/Templates/Empty/game/shaders/common/gl/fxFoliageReplicatorP.glsl @@ -29,12 +29,14 @@ uniform vec4 groundAlpha; in vec4 color, groundAlphaCoeff; in vec2 outTexCoord, alphaLookup; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- void main() { 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; } diff --git a/Templates/Empty/game/shaders/common/gl/hlslCompat.glsl b/Templates/Empty/game/shaders/common/gl/hlslCompat.glsl index 86121f9e6..c8fe73620 100644 --- a/Templates/Empty/game/shaders/common/gl/hlslCompat.glsl +++ b/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 void clip(float a) { if(a < 0) discard;} - - out vec4 OUT_col; - #define OUT_FragColor0 OUT_col #endif diff --git a/Templates/Empty/game/shaders/common/gl/particleCompositeP.glsl b/Templates/Empty/game/shaders/common/gl/particleCompositeP.glsl index 6971e1013..e33c9bd97 100644 --- a/Templates/Empty/game/shaders/common/gl/particleCompositeP.glsl +++ b/Templates/Empty/game/shaders/common/gl/particleCompositeP.glsl @@ -38,6 +38,7 @@ uniform sampler2D edgeSource; uniform vec4 edgeTargetParams; #endif +out vec4 OUT_col; void main() { @@ -57,5 +58,5 @@ void main() #endif // Sample offscreen target and return - OUT_FragColor0 = texture( colorSource, uvScene.xy ); + OUT_col = texture( colorSource, uvScene.xy ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/gl/particlesP.glsl b/Templates/Empty/game/shaders/common/gl/particlesP.glsl index efd930302..813e31a1d 100644 --- a/Templates/Empty/game/shaders/common/gl/particlesP.glsl +++ b/Templates/Empty/game/shaders/common/gl/particlesP.glsl @@ -78,6 +78,8 @@ vec4 lmSample( vec3 nrm ) uniform float alphaFactor; uniform float alphaScale; +out vec4 OUT_col; + void main() { float softBlend = 1; @@ -100,12 +102,12 @@ void main() 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) 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 ) ); } diff --git a/Templates/Empty/game/shaders/common/gl/planarReflectBumpP.glsl b/Templates/Empty/game/shaders/common/gl/planarReflectBumpP.glsl index 334c70a70..db4250487 100644 --- a/Templates/Empty/game/shaders/common/gl/planarReflectBumpP.glsl +++ b/Templates/Empty/game/shaders/common/gl/planarReflectBumpP.glsl @@ -29,6 +29,8 @@ uniform vec4 shadeColor; in vec2 TEX0; in vec4 TEX1; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Fade edges of axis for texcoord passed in //----------------------------------------------------------------------------- @@ -64,5 +66,5 @@ void main() vec4 diffuseColor = texture( diffuseMap, TEX0 ); vec4 reflectColor = textureProj( refractMap, texIndex ); - OUT_FragColor0 = diffuseColor + reflectColor * diffuseColor.a; + OUT_col = diffuseColor + reflectColor * diffuseColor.a; } diff --git a/Templates/Empty/game/shaders/common/gl/planarReflectP.glsl b/Templates/Empty/game/shaders/common/gl/planarReflectP.glsl index 77914b80e..384c16188 100644 --- a/Templates/Empty/game/shaders/common/gl/planarReflectP.glsl +++ b/Templates/Empty/game/shaders/common/gl/planarReflectP.glsl @@ -29,6 +29,8 @@ uniform vec4 shadeColor; in vec2 TEX0; in vec4 TEX1; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- @@ -37,5 +39,5 @@ void main() vec4 diffuseColor = texture( diffuseMap, TEX0 ); vec4 reflectColor = textureProj( refractMap, TEX1 ); - OUT_FragColor0 = diffuseColor + reflectColor * diffuseColor.a; + OUT_col = diffuseColor + reflectColor * diffuseColor.a; } diff --git a/Templates/Empty/game/shaders/common/gl/precipP.glsl b/Templates/Empty/game/shaders/common/gl/precipP.glsl index 3c669517d..102d0b0aa 100644 --- a/Templates/Empty/game/shaders/common/gl/precipP.glsl +++ b/Templates/Empty/game/shaders/common/gl/precipP.glsl @@ -28,10 +28,12 @@ uniform sampler2D diffuseMap; in vec4 color; in vec2 texCoord; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- void main() { - OUT_FragColor0 = texture(diffuseMap, texCoord) * color; + OUT_col = texture(diffuseMap, texCoord) * color; } diff --git a/Templates/Empty/game/shaders/common/gl/projectedShadowP.glsl b/Templates/Empty/game/shaders/common/gl/projectedShadowP.glsl index 8ce0fba13..9b0ff0d0b 100644 --- a/Templates/Empty/game/shaders/common/gl/projectedShadowP.glsl +++ b/Templates/Empty/game/shaders/common/gl/projectedShadowP.glsl @@ -24,7 +24,7 @@ in vec2 texCoord; in vec4 color; in float fade; -out vec4 OUT_FragColor0; +out vec4 OUT_col; uniform sampler2D inputTex; uniform vec4 ambient; @@ -33,5 +33,5 @@ uniform vec4 ambient; void main() { float shadow = texture( inputTex, texCoord ).a * color.a; - OUT_FragColor0 = ( ambient * shadow ) + ( 1 - shadow ); + OUT_col = ( ambient * shadow ) + ( 1 - shadow ); } diff --git a/Templates/Empty/game/shaders/common/gl/scatterSkyP.glsl b/Templates/Empty/game/shaders/common/gl/scatterSkyP.glsl index 691567a37..d9fa80bcf 100644 --- a/Templates/Empty/game/shaders/common/gl/scatterSkyP.glsl +++ b/Templates/Empty/game/shaders/common/gl/scatterSkyP.glsl @@ -43,6 +43,8 @@ uniform float useCubemap; uniform vec3 lightDir; uniform vec3 sunDir; +out vec4 OUT_col; + void main() { @@ -62,7 +64,7 @@ void main() float fac = dot( normalize( pos ), sunDir ); 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 // z position of the vertex, passed through @@ -70,6 +72,6 @@ void main() if(zPosition < 0.0) discard; - OUT_FragColor0.a = 1; - OUT_FragColor0 = hdrEncode( OUT_FragColor0 ); + OUT_col.a = 1; + OUT_col = hdrEncode( OUT_col ); } diff --git a/Templates/Empty/game/shaders/common/gl/torque.glsl b/Templates/Empty/game/shaders/common/gl/torque.glsl index a98ef859f..42965b7c3 100644 --- a/Templates/Empty/game/shaders/common/gl/torque.glsl +++ b/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 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. -#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_ diff --git a/Templates/Empty/game/shaders/common/gl/wavesP.glsl b/Templates/Empty/game/shaders/common/gl/wavesP.glsl index ddb683947..06c8a1a28 100644 --- a/Templates/Empty/game/shaders/common/gl/wavesP.glsl +++ b/Templates/Empty/game/shaders/common/gl/wavesP.glsl @@ -33,6 +33,8 @@ in vec4 outLightVec; in vec3 outPos; in vec3 outEyePos; +out vec4 OUT_col; + void main() { vec2 texOffset; @@ -45,11 +47,11 @@ void main() vec4 bumpNorm = texture(bumpMap, texOffset) * 2.0 - 1.0; 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 halfAng = normalize(eyeVec + outLightVec.xyz); float specular = clamp(dot(bumpNorm.xyz, halfAng), 0.0, 1.0) * outLightVec.w; specular = pow(specular, specularPower); - OUT_FragColor0 += specularColor * specular; + OUT_col += specularColor * specular; } diff --git a/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl b/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl index e3ee59c8a..7c1754097 100644 --- a/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl +++ b/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl @@ -27,8 +27,10 @@ in vec2 uv0; uniform sampler2D prepassBuffer; uniform sampler1D depthViz; +out vec4 OUT_col; + void main() { float depth = prepassUncondition( prepassBuffer, uv0 ).w; - OUT_FragColor0 = vec4( texture( depthViz, depth ).rgb, 1.0 ); + OUT_col = vec4( texture( depthViz, depth ).rgb, 1.0 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl b/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl index aa17df4d6..05645e193 100644 --- a/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl +++ b/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl @@ -26,10 +26,12 @@ in vec2 uv0; uniform sampler2D lightInfoBuffer; +out vec4 OUT_col; + void main() { vec3 lightcolor; float nl_Att, specular; lightinfoUncondition( texture( lightInfoBuffer, uv0 ), lightcolor, nl_Att, specular ); - OUT_FragColor0 = vec4( lightcolor, 1.0 ); + OUT_col = vec4( lightcolor, 1.0 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl b/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl index e549922ff..7e3e41ee9 100644 --- a/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl +++ b/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl @@ -26,10 +26,12 @@ in vec2 uv0; uniform sampler2D lightInfoBuffer; +out vec4 OUT_col; + void main() { vec3 lightcolor; float 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 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl b/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl index f61706393..dfc611e88 100644 --- a/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl +++ b/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl @@ -26,8 +26,10 @@ in vec2 uv0; uniform sampler2D prepassBuffer; +out vec4 OUT_col; + void main() { 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 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl b/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl index e997950ab..b51e7310a 100644 --- a/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl +++ b/Templates/Empty/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl @@ -25,8 +25,10 @@ in vec2 uv0; uniform sampler2D shadowMap; uniform sampler1D depthViz; +out vec4 OUT_col; + void main() { float depth = saturate( texture( shadowMap, uv0 ).r ); - OUT_FragColor0 = vec4( texture( depthViz, depth ).rgb, 1 ); + OUT_col = vec4( texture( depthViz, depth ).rgb, 1 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/lighting/advanced/gl/pointLightP.glsl b/Templates/Empty/game/shaders/common/lighting/advanced/gl/pointLightP.glsl index c0610508b..3bfd94900 100644 --- a/Templates/Empty/game/shaders/common/lighting/advanced/gl/pointLightP.glsl +++ b/Templates/Empty/game/shaders/common/lighting/advanced/gl/pointLightP.glsl @@ -122,6 +122,7 @@ uniform mat3 viewToLightProj; uniform vec4 lightParams; uniform float shadowSoftness; +out vec4 OUT_col; void main() { @@ -229,5 +230,5 @@ void main() addToResult = ( 1.0 - shadowed ) * abs(lightMapParams); } - OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); + OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); } diff --git a/Templates/Empty/game/shaders/common/lighting/advanced/gl/spotLightP.glsl b/Templates/Empty/game/shaders/common/lighting/advanced/gl/spotLightP.glsl index c07be1f34..b3920ec9a 100644 --- a/Templates/Empty/game/shaders/common/lighting/advanced/gl/spotLightP.glsl +++ b/Templates/Empty/game/shaders/common/lighting/advanced/gl/spotLightP.glsl @@ -63,6 +63,8 @@ uniform mat4 viewToLightProj; uniform vec4 lightParams; uniform float shadowSoftness; +out vec4 OUT_col; + void main() { // Compute scene UV @@ -162,5 +164,5 @@ void main() addToResult = ( 1.0 - shadowed ) * abs(lightMapParams); } - OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); + OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); } diff --git a/Templates/Empty/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl b/Templates/Empty/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl index 0178c35ea..42e46f2dc 100644 --- a/Templates/Empty/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl +++ b/Templates/Empty/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl @@ -62,6 +62,8 @@ uniform vec4 farPlaneScalePSSM; uniform vec4 overDarkPSSM; uniform float shadowSoftness; +out vec4 OUT_col; + void main() { // Sample/unpack the normal/z data @@ -227,6 +229,6 @@ void main() lightColorOut = debugColor; #endif - OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); + OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); } diff --git a/Templates/Empty/game/shaders/common/lighting/basic/gl/shadowFilterP.glsl b/Templates/Empty/game/shaders/common/lighting/basic/gl/shadowFilterP.glsl index 4e97fa347..9b510e0cf 100644 --- a/Templates/Empty/game/shaders/common/lighting/basic/gl/shadowFilterP.glsl +++ b/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 weight[3] = float[]( 0.2270270270, 0.3162162162, 0.0702702703 ); +out vec4 OUT_col; + void main() { - vec4 OUT = texture( diffuseMap, uv ) * weight[0]; + OUT_col = texture( diffuseMap, uv ) * weight[0]; for ( int i=1; i < 3; i++ ) { 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; } diff --git a/Templates/Empty/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl b/Templates/Empty/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl index 0f568c716..d4e05132b 100644 --- a/Templates/Empty/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl +++ b/Templates/Empty/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl @@ -28,6 +28,8 @@ uniform vec2 blurDimension; in vec2 tex0; +out vec4 OUT_col; + void main() { // Preshader @@ -43,5 +45,5 @@ void main() accum += texture(diffuseMap0, BaseTexCoord + float(i) * SampleOffset); } accum /= blurSamples; - OUT_FragColor0 = accum; + OUT_col = accum; } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/caustics/gl/causticsP.glsl b/Templates/Empty/game/shaders/common/postFx/caustics/gl/causticsP.glsl index 6f5d68c87..2d2a54154 100644 --- a/Templates/Empty/game/shaders/common/postFx/caustics/gl/causticsP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/caustics/gl/causticsP.glsl @@ -34,6 +34,8 @@ uniform sampler2D causticsTex0; uniform sampler2D causticsTex1; uniform vec2 targetSize; +out vec4 OUT_col; + float distanceToPlane(vec4 plane, vec3 pos) { 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; if(depth > 0.9999) { - OUT_FragColor0 = vec4(0,0,0,0); + OUT_col = vec4(0,0,0,0); return; } @@ -59,7 +61,7 @@ void main() float waterDepth = -distanceToPlane(waterFogPlane, pos); if(waterDepth < 0) { - OUT_FragColor0 = vec4(0,0,0,0); + OUT_col = vec4(0,0,0,0); return; } waterDepth = saturate(waterDepth); @@ -81,5 +83,5 @@ void main() //float waterDepth = 1 - saturate(pos.z + waterFogPlane.w + 1); caustics *= saturate(prePass.z) * pow(1-depth, 64) * waterDepth; - OUT_FragColor0 = caustics; + OUT_col = caustics; } diff --git a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl b/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl index af3ce91f4..9bfad955c 100644 --- a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl +++ b/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl @@ -25,7 +25,9 @@ // These are set by the game engine. 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 // value used for the near circle of confusion. @@ -46,8 +48,8 @@ void main() 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 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl b/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl index b81a6ac92..6b7cf4eca 100644 --- a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl +++ b/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl @@ -47,6 +47,8 @@ in vec2 tcDepth2; in vec2 tcDepth3; #define IN_tcDepth3 tcDepth3 +out vec4 OUT_col; + void main() { //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] ) ); - //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 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_Final_P.glsl b/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_Final_P.glsl index 2adcfae7a..40b71bc27 100644 --- a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_Final_P.glsl +++ b/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 vec3 dofEqFar = vec3( 2.0, 0.0, 1.0 ); +out vec4 OUT_col; + vec4 tex2Doffset( sampler2D s, vec2 tc, vec2 offset ) { return texture( s, tc + offset * oneOverTargetSize ); @@ -141,5 +143,5 @@ void main() //return half4(nearCoc.rrr,1); //return half4( 1,0,1,0 ); - OUT_FragColor0 = InterpolateDof( small, med.rgb, large, coc ); + OUT_col = InterpolateDof( small, med.rgb, large, coc ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_Gausian_P.glsl b/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_Gausian_P.glsl index 979caced6..61e7697af 100644 --- a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_Gausian_P.glsl +++ b/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_Gausian_P.glsl @@ -42,7 +42,7 @@ in vec2 uv6; in vec2 uv7; #define IN_uv7 uv7 -#define OUT OUT_FragColor0 +out vec4 OUT_col; 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; - 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 // can use alpha test to save fillrate. //vec3 rgb2lum = vec3( 0.30, 0.59, 0.11 ); - //OUT.a = dot( OUT.rgb, rgb2lum ); + //OUT_col.a = dot( OUT_col.rgb, rgb2lum ); } diff --git a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_SmallBlur_P.glsl b/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_SmallBlur_P.glsl index a6d1ecabc..ae94edd78 100644 --- a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_SmallBlur_P.glsl +++ b/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; #define IN_texCoords texCoords +out vec4 OUT_col; + void main() { vec4 color; @@ -40,5 +42,5 @@ void main() color += texture( colorSampler, IN_texCoords.yz ); color += texture( colorSampler, IN_texCoords.xw ); color += texture( colorSampler, IN_texCoords.yw ); - OUT_FragColor0 = color / 4.0; + OUT_col = color / 4.0; } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/dbgEdgeDisplayP.glsl b/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/dbgEdgeDisplayP.glsl index d02e3b825..ccc3b8ba5 100644 --- a/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/dbgEdgeDisplayP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/dbgEdgeDisplayP.glsl @@ -28,7 +28,9 @@ in vec2 uv0; uniform sampler2D edgeBuffer; +out vec4 OUT_col; + void main() { - OUT_FragColor0 = vec4( texture( edgeBuffer, IN_uv0 ).rrr, 1.0 ); + OUT_col = vec4( texture( edgeBuffer, IN_uv0 ).rrr, 1.0 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeAAP.glsl b/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeAAP.glsl index e43c69bc1..216dc8725 100644 --- a/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeAAP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeAAP.glsl @@ -28,6 +28,8 @@ uniform sampler2D edgeBuffer; uniform sampler2D backBuffer; uniform vec2 targetSize; +out vec4 OUT_col; + void main() { vec2 pixelSize = 1.0 / targetSize; @@ -64,5 +66,5 @@ void main() } accumColor /= 9.0; - OUT_FragColor0 = accumColor; + OUT_col = accumColor; } diff --git a/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeDetectP.glsl b/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeDetectP.glsl index 26dc26e8f..d1856ecde 100644 --- a/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeDetectP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/edgeaa/gl/edgeDetectP.glsl @@ -88,7 +88,9 @@ in vec2 uv0; uniform sampler2D prepassBuffer; uniform vec2 targetSize; +out vec4 OUT_col; + void main() { - OUT_FragColor0 = vec4( GetEdgeWeight(IN_uv0, prepassBuffer, targetSize ) );//rtWidthHeightInvWidthNegHeight.zw); + OUT_col = vec4( GetEdgeWeight(IN_uv0, prepassBuffer, targetSize ) );//rtWidthHeightInvWidthNegHeight.zw); } diff --git a/Templates/Empty/game/shaders/common/postFx/fxaa/gl/fxaaP.glsl b/Templates/Empty/game/shaders/common/postFx/fxaa/gl/fxaaP.glsl index e15671564..19d76ef42 100644 --- a/Templates/Empty/game/shaders/common/postFx/fxaa/gl/fxaaP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/fxaa/gl/fxaaP.glsl @@ -34,9 +34,11 @@ uniform vec2 oneOverTargetSize; in vec4 hpos; in vec2 uv0; +out vec4 OUT_col; + void main() { - OUT_FragColor0 = FxaaPixelShader( + OUT_col = FxaaPixelShader( uv0, // vertex position diff --git a/Templates/Empty/game/shaders/common/postFx/gl/chromaticLens.glsl b/Templates/Empty/game/shaders/common/postFx/gl/chromaticLens.glsl index 4e04aabbb..0c02c3742 100644 --- a/Templates/Empty/game/shaders/common/postFx/gl/chromaticLens.glsl +++ b/Templates/Empty/game/shaders/common/postFx/gl/chromaticLens.glsl @@ -32,6 +32,8 @@ uniform float distCoeff; uniform float cubeDistort; uniform vec3 colorDistort; +out vec4 OUT_col; + void main() { vec2 tex = IN_uv0; @@ -56,5 +58,5 @@ void main() outColor[i] = tex2Dlod( backBuffer, vec4(x,y,0,0) )[i]; } - OUT_FragColor0 = vec4( outColor.rgb, 1 ); + OUT_col = vec4( outColor.rgb, 1 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/gl/flashP.glsl b/Templates/Empty/game/shaders/common/postFx/gl/flashP.glsl index d03665fe2..a287a135f 100644 --- a/Templates/Empty/game/shaders/common/postFx/gl/flashP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/gl/flashP.glsl @@ -28,10 +28,12 @@ uniform float damageFlash; uniform float whiteOut; uniform sampler2D backBuffer; +out vec4 OUT_col; + void main() { vec4 color1 = texture(backBuffer, IN_uv0); vec4 color2 = color1 * MUL_COLOR; vec4 damage = mix(color1,color2,damageFlash); - OUT_FragColor0 = mix(damage,WHITE_COLOR,whiteOut); + OUT_col = mix(damage,WHITE_COLOR,whiteOut); } diff --git a/Templates/Empty/game/shaders/common/postFx/gl/fogP.glsl b/Templates/Empty/game/shaders/common/postFx/gl/fogP.glsl index aff559f78..7b0d71933 100644 --- a/Templates/Empty/game/shaders/common/postFx/gl/fogP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/gl/fogP.glsl @@ -34,6 +34,8 @@ uniform vec4 rtParams0; in vec2 uv0; in vec3 wsEyeRay; +out vec4 OUT_col; + void main() { //vec2 prepassCoord = ( uv0.xy * rtParams0.zw ) + rtParams0.xy; @@ -46,5 +48,5 @@ void main() fogData.y, fogData.z ); - OUT_FragColor0 = hdrEncode( vec4( fogColor.rgb, 1.0 - saturate( factor ) ) ); + OUT_col = hdrEncode( vec4( fogColor.rgb, 1.0 - saturate( factor ) ) ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/gl/gammaP.glsl b/Templates/Empty/game/shaders/common/postFx/gl/gammaP.glsl index c27dbb042..414a277d3 100644 --- a/Templates/Empty/game/shaders/common/postFx/gl/gammaP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/gl/gammaP.glsl @@ -31,6 +31,8 @@ uniform float OneOverGamma; in vec2 uv0; +out vec4 OUT_col; + void main() { vec4 color = texture(backBuffer, uv0.xy); @@ -43,5 +45,5 @@ void main() // Apply gamma correction color.rgb = pow( abs(color.rgb), vec3(OneOverGamma) ); - OUT_FragColor0 = color; + OUT_col = color; } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/gl/glowBlurP.glsl b/Templates/Empty/game/shaders/common/postFx/gl/glowBlurP.glsl index 4cb777f3f..910c512b6 100644 --- a/Templates/Empty/game/shaders/common/postFx/gl/glowBlurP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/gl/glowBlurP.glsl @@ -34,25 +34,26 @@ in vec2 uv5; //TEXCOORD5; in vec2 uv6; //TEXCOORD6; in vec2 uv7; //TEXCOORD7; +out vec4 OUT_col; + void main() { vec4 kernel = vec4( 0.175, 0.275, 0.375, 0.475 ) * 0.5f; + + 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; - 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; + 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 // can use alpha test to save fillrate. 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 ); + } diff --git a/Templates/Empty/game/shaders/common/postFx/gl/motionBlurP.glsl b/Templates/Empty/game/shaders/common/postFx/gl/motionBlurP.glsl index e46547d19..56333e776 100644 --- a/Templates/Empty/game/shaders/common/postFx/gl/motionBlurP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/gl/motionBlurP.glsl @@ -37,6 +37,8 @@ uniform float velocityMultiplier; uniform sampler2D backBuffer; uniform sampler2D prepassTex; +out vec4 OUT_col; + void main() { vec2 IN_uv0 = _IN_uv0; @@ -72,5 +74,5 @@ void main() color += currentColor; } - OUT_FragColor0 = color / samples; + OUT_col = color / samples; } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/gl/passthruP.glsl b/Templates/Empty/game/shaders/common/postFx/gl/passthruP.glsl index 599d4a177..47a1e4eaf 100644 --- a/Templates/Empty/game/shaders/common/postFx/gl/passthruP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/gl/passthruP.glsl @@ -25,7 +25,9 @@ in vec2 uv0; uniform sampler2D inputTex ; +out vec4 OUT_col; + void main() { - OUT_FragColor0 = texture( inputTex, uv0 ); + OUT_col = texture( inputTex, uv0 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/gl/turbulenceP.glsl b/Templates/Empty/game/shaders/common/postFx/gl/turbulenceP.glsl index 790742bf2..9b97d971d 100644 --- a/Templates/Empty/game/shaders/common/postFx/gl/turbulenceP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/gl/turbulenceP.glsl @@ -34,6 +34,8 @@ in vec2 uv0; #define IN_uv0 uv0 +out vec4 OUT_col; + void main() { float speed = 2.0; @@ -46,5 +48,5 @@ void main() y = clamp(y, targetViewport.y, targetViewport.w); x = clamp(x, targetViewport.x, targetViewport.z); - OUT_FragColor0 = texture (inputTex, vec2(x, y)); + OUT_col = texture (inputTex, vec2(x, y)); } diff --git a/Templates/Empty/game/shaders/common/postFx/gl/underwaterFogP.glsl b/Templates/Empty/game/shaders/common/postFx/gl/underwaterFogP.glsl index 864942f71..33cfae7bd 100644 --- a/Templates/Empty/game/shaders/common/postFx/gl/underwaterFogP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/gl/underwaterFogP.glsl @@ -51,6 +51,8 @@ uniform vec2 nearFar; uniform vec4 rtParams0; uniform float waterDepthGradMax; +out vec4 OUT_col; + void main() { //vec2 prepassCoord = IN_uv0; @@ -134,5 +136,5 @@ void main() vec3 outColor = mix( inColor, fogColor.rgb, fogAmt ); - OUT_FragColor0 = vec4( hdrEncode( outColor ), 1 ); + OUT_col = vec4( hdrEncode( outColor ), 1 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurHP.glsl b/Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurHP.glsl index 37780d073..1d9a2df3e 100644 --- a/Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurHP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurHP.glsl @@ -30,6 +30,8 @@ uniform float gaussMultiplier; uniform float gaussMean; uniform float gaussStdDev; +out vec4 OUT_col; + #define PI 3.141592654 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 ); } - OUT_FragColor0 = vec4( color.rgb, 1.0f ); + OUT_col = vec4( color.rgb, 1.0f ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurVP.glsl b/Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurVP.glsl index f236186b7..68f34b164 100644 --- a/Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurVP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/hdr/gl/bloomGaussBlurVP.glsl @@ -30,6 +30,8 @@ uniform float gaussMultiplier; uniform float gaussMean; uniform float gaussStdDev; +out vec4 OUT_col; + #define D3DX_PI 3.141592654 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 ); } - OUT_FragColor0 = vec4( color.rgb, 1.0f ); + OUT_col = vec4( color.rgb, 1.0f ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/hdr/gl/brightPassFilterP.glsl b/Templates/Empty/game/shaders/common/postFx/hdr/gl/brightPassFilterP.glsl index 4649e8559..f220ca1e7 100644 --- a/Templates/Empty/game/shaders/common/postFx/hdr/gl/brightPassFilterP.glsl +++ b/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); +out vec4 OUT_col; + const vec2 gTapOffsets[4] = vec2[] ( @@ -59,5 +61,5 @@ void main() average = vec4( 0.0f, 0.0f, 0.0f, 1.0f ); // Write the colour to the bright-pass render target - OUT_FragColor0 = hdrEncode( average ); + OUT_col = hdrEncode( average ); } diff --git a/Templates/Empty/game/shaders/common/postFx/hdr/gl/calculateAdaptedLumP.glsl b/Templates/Empty/game/shaders/common/postFx/hdr/gl/calculateAdaptedLumP.glsl index ac883c54e..96ee9d6df 100644 --- a/Templates/Empty/game/shaders/common/postFx/hdr/gl/calculateAdaptedLumP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/hdr/gl/calculateAdaptedLumP.glsl @@ -30,6 +30,8 @@ uniform sampler2D lastAdaptedLum; uniform float adaptRate; uniform float deltaTime; +out vec4 OUT_col; + void main() { float fAdaptedLum = texture( lastAdaptedLum, vec2(0.5f, 0.5f) ).r; @@ -42,5 +44,5 @@ void main() float diff = fCurrentLum - fAdaptedLum; 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 ); } diff --git a/Templates/Empty/game/shaders/common/postFx/hdr/gl/downScale4x4P.glsl b/Templates/Empty/game/shaders/common/postFx/hdr/gl/downScale4x4P.glsl index 77b378ac8..131671760 100644 --- a/Templates/Empty/game/shaders/common/postFx/hdr/gl/downScale4x4P.glsl +++ b/Templates/Empty/game/shaders/common/postFx/hdr/gl/downScale4x4P.glsl @@ -30,6 +30,8 @@ in vec4 texCoords[8]; uniform sampler2D inputTex; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- @@ -44,5 +46,5 @@ void main() _sample += texture( inputTex, IN_texCoords[i].zw ); } - OUT_FragColor0 = _sample / 16; + OUT_col = _sample / 16; } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/hdr/gl/finalPassCombineP.glsl b/Templates/Empty/game/shaders/common/postFx/hdr/gl/finalPassCombineP.glsl index ddc2fe4fd..38762baa5 100644 --- a/Templates/Empty/game/shaders/common/postFx/hdr/gl/finalPassCombineP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/hdr/gl/finalPassCombineP.glsl @@ -43,6 +43,8 @@ uniform float g_fBloomScale; uniform float g_fOneOverGamma; +out vec4 OUT_col; + void main() { @@ -92,5 +94,5 @@ void main() // Apply gamma correction _sample.rgb = pow( abs(_sample.rgb), vec3(g_fOneOverGamma) ); - OUT_FragColor0 = _sample; + OUT_col = _sample; } diff --git a/Templates/Empty/game/shaders/common/postFx/hdr/gl/luminanceVisP.glsl b/Templates/Empty/game/shaders/common/postFx/hdr/gl/luminanceVisP.glsl index d389b4125..ee9c28c87 100644 --- a/Templates/Empty/game/shaders/common/postFx/hdr/gl/luminanceVisP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/hdr/gl/luminanceVisP.glsl @@ -28,6 +28,8 @@ uniform sampler2D inputTex; uniform float brightPassThreshold; +out vec4 OUT_col; + void main() { vec4 _sample = hdrDecode( texture( inputTex, IN_uv0 ) ); @@ -36,5 +38,5 @@ void main() float lum = hdrLuminance( _sample.rgb ); // Write the colour to the bright-pass render target - OUT_FragColor0 = ( vec4( lum.rrr, 1 ) ); + OUT_col = ( vec4( lum.rrr, 1 ) ); } diff --git a/Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumInitialP.glsl b/Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumInitialP.glsl index 218cb455f..8a2b9b318 100644 --- a/Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumInitialP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumInitialP.glsl @@ -29,6 +29,8 @@ uniform vec2 texSize0; uniform float g_fMinLuminace; +out vec4 OUT_col; + const vec2 gTapOffsets[9] = vec2[] ( 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 ); - OUT_FragColor0 = vec4( average, 0.0, 0.0, 1.0 ); + OUT_col = vec4( average, 0.0, 0.0, 1.0 ); } diff --git a/Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumIterativeP.glsl b/Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumIterativeP.glsl index 9550f1cf1..2e800d612 100644 --- a/Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumIterativeP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/hdr/gl/sampleLumIterativeP.glsl @@ -26,6 +26,7 @@ uniform sampler2D inputTex; uniform vec2 oneOverTargetSize; +out vec4 OUT_col; const vec2 gTapOffsets[16] = vec2[] ( @@ -47,5 +48,5 @@ void main() 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 ); } diff --git a/Templates/Empty/game/shaders/common/postFx/lightRay/gl/lightRayOccludeP.glsl b/Templates/Empty/game/shaders/common/postFx/lightRay/gl/lightRayOccludeP.glsl index 8635e843c..01c7658aa 100644 --- a/Templates/Empty/game/shaders/common/postFx/lightRay/gl/lightRayOccludeP.glsl +++ b/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); +out vec4 OUT_col; void main() { @@ -50,5 +51,5 @@ void main() col *= brightScalar; } - OUT_FragColor0 = col; + OUT_col = col; } diff --git a/Templates/Empty/game/shaders/common/postFx/lightRay/gl/lightRayP.glsl b/Templates/Empty/game/shaders/common/postFx/lightRay/gl/lightRayP.glsl index 9575b8de0..4e06edb4b 100644 --- a/Templates/Empty/game/shaders/common/postFx/lightRay/gl/lightRayP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/lightRay/gl/lightRayP.glsl @@ -36,6 +36,8 @@ uniform float weight; uniform float decay; uniform float exposure; +out vec4 OUT_col; + void main() { vec4 texCoord = vec4( IN_uv0.xy, 0, 0 ); @@ -55,7 +57,7 @@ void main() if ( samples <= 0 ) { - OUT_FragColor0 = bbCol; + OUT_col = bbCol; return; } @@ -88,5 +90,5 @@ void main() //return bbCol * decay; // 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; } diff --git a/Templates/Empty/game/shaders/common/postFx/mlaa/gl/blendWeightCalculationP.glsl b/Templates/Empty/game/shaders/common/postFx/mlaa/gl/blendWeightCalculationP.glsl index 85bfff633..af01ce6f9 100644 --- a/Templates/Empty/game/shaders/common/postFx/mlaa/gl/blendWeightCalculationP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/mlaa/gl/blendWeightCalculationP.glsl @@ -34,6 +34,8 @@ uniform sampler2D edgesMap; uniform sampler2D edgesMapL; uniform sampler2D areaMap; +out vec4 OUT_col; + #include "./functions.glsl" @@ -77,5 +79,5 @@ void main() areas.ba = Area(abs(d), e1, e2); } - OUT_FragColor0 = areas; + OUT_col = areas; } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/mlaa/gl/edgeDetectionP.glsl b/Templates/Empty/game/shaders/common/postFx/mlaa/gl/edgeDetectionP.glsl index 7e59fa1de..362f29b5c 100644 --- a/Templates/Empty/game/shaders/common/postFx/mlaa/gl/edgeDetectionP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/mlaa/gl/edgeDetectionP.glsl @@ -39,6 +39,8 @@ uniform float depthThreshold; in vec2 texcoord; in vec4 offset[2]; +out vec4 OUT_col; + void main() { // Luma calculation requires gamma-corrected colors (texture 'colorMapG'). @@ -70,5 +72,5 @@ void main() if (dot(edges, vec4(1.0)) == 0.0) discard; - OUT_FragColor0 = edges; + OUT_col = edges; } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/mlaa/gl/neighborhoodBlendingP.glsl b/Templates/Empty/game/shaders/common/postFx/mlaa/gl/neighborhoodBlendingP.glsl index bba266930..eddbcc47c 100644 --- a/Templates/Empty/game/shaders/common/postFx/mlaa/gl/neighborhoodBlendingP.glsl +++ b/Templates/Empty/game/shaders/common/postFx/mlaa/gl/neighborhoodBlendingP.glsl @@ -40,6 +40,7 @@ uniform sampler2D areaMap; uniform sampler2D edgesMapL; #include "./functions.glsl" +out vec4 OUT_col; void main() { @@ -83,5 +84,5 @@ void main() #endif // Normalize the resulting color and we are finished! - OUT_FragColor0 = color / sum; + OUT_col = color / sum; } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_Blur_P.glsl b/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_Blur_P.glsl index 9e9f58d99..f0de9396f 100644 --- a/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_Blur_P.glsl +++ b/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_Blur_P.glsl @@ -46,6 +46,7 @@ uniform sampler2D prepassMap ; uniform float blurDepthTol; uniform float blurNormalTol; +out vec4 OUT_col; 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 /= total; - OUT_FragColor0 = vec4( vec3(occlusion), 1 ); + OUT_col = vec4( vec3(occlusion), 1 ); //return vec4( 0,0,0,occlusion ); diff --git a/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_P.glsl b/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_P.glsl index 0d0e5c7b2..7ee6a412a 100644 --- a/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_P.glsl +++ b/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_P.glsl @@ -57,6 +57,8 @@ uniform float lDepthPow; uniform float lNormalTol; uniform float lNormalPow; +out vec4 OUT_col; + #ifndef QUALITY #define QUALITY 2 @@ -152,7 +154,7 @@ void main() // Early out if too far away. if ( depth > 0.99999999 ) { - OUT_FragColor0 = vec4( 0,0,0,0 ); + OUT_col = vec4( 0,0,0,0 ); return; } @@ -270,7 +272,7 @@ void main() // seems backwards, but it makes it simple to deal with the SSAO // being disabled in the lighting shaders. - OUT_FragColor0 = vec4(occlusion, vec3(0.0)); + OUT_col = vec4(occlusion, vec3(0.0)); } diff --git a/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_PowerTable_P.glsl b/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_PowerTable_P.glsl index 49374bf70..4f49479ba 100644 --- a/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_PowerTable_P.glsl +++ b/Templates/Empty/game/shaders/common/postFx/ssao/gl/SSAO_PowerTable_P.glsl @@ -25,8 +25,10 @@ in vec2 uv0; #define IN_uv0 uv0 +out vec4 OUT_col; + void main() { float power = pow( max( IN_uv0.x, 0 ), 0.1 ); - OUT_FragColor0 = vec4( power, 0, 0, 1 ); + OUT_col = vec4( power, 0, 0, 1 ); } \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/terrain/gl/blendP.glsl b/Templates/Empty/game/shaders/common/terrain/gl/blendP.glsl index a2e4af787..3189ea01d 100644 --- a/Templates/Empty/game/shaders/common/terrain/gl/blendP.glsl +++ b/Templates/Empty/game/shaders/common/terrain/gl/blendP.glsl @@ -33,6 +33,8 @@ uniform sampler2D textureMap; uniform float texId; uniform float layerSize; +out vec4 OUT_col; + void main() { vec4 layerSample = round(texture( layerTex, IN_layerCoord ) * 255.0); @@ -42,5 +44,5 @@ void main() if(blend - 0.0001 < 0.0) discard; - OUT_FragColor0 = vec4( texture( textureMap, IN_texCoord ).rgb, blend ); + OUT_col = vec4( texture( textureMap, IN_texCoord ).rgb, blend ); } diff --git a/Templates/Empty/game/shaders/common/water/gl/waterBasicP.glsl b/Templates/Empty/game/shaders/common/water/gl/waterBasicP.glsl index 44207dea9..f84a8feb4 100644 --- a/Templates/Empty/game/shaders/common/water/gl/waterBasicP.glsl +++ b/Templates/Empty/game/shaders/common/water/gl/waterBasicP.glsl @@ -111,6 +111,8 @@ uniform vec4 rippleMagnitude; uniform vec4 specularParams; uniform mat4 modelMat; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- @@ -136,7 +138,7 @@ void main() distortPos.xy += bumpNorm.xy * distortAmt; #ifdef UNDERWATER - OUT_FragColor0 = hdrEncode( textureProj( refractBuff, distortPos ) ); + OUT_col = hdrEncode( textureProj( refractBuff, distortPos ) ); #else vec3 eyeVec = IN_objPos.xyz - eyePos; @@ -208,7 +210,7 @@ void main() #endif - OUT_FragColor0 = OUT; + OUT_col = OUT; #endif } diff --git a/Templates/Empty/game/shaders/common/water/gl/waterP.glsl b/Templates/Empty/game/shaders/common/water/gl/waterP.glsl index 3e15fe576..af151020a 100644 --- a/Templates/Empty/game/shaders/common/water/gl/waterP.glsl +++ b/Templates/Empty/game/shaders/common/water/gl/waterP.glsl @@ -145,6 +145,8 @@ uniform vec4 sunColor; uniform float sunBrightness; uniform float reflectivity; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- @@ -390,5 +392,5 @@ void main() //return OUT; - OUT_FragColor0 = hdrEncode( OUT ); + OUT_col = hdrEncode( OUT ); } diff --git a/Templates/Full/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl b/Templates/Full/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl index 09ad48cef..b9a10adf3 100644 --- a/Templates/Full/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl +++ b/Templates/Full/game/shaders/common/fixedFunction/gl/addColorTextureP.glsl @@ -24,9 +24,9 @@ uniform sampler2D diffuseMap; in vec4 color; in vec2 texCoord; -out vec4 OUT_FragColor0; +out vec4 OUT_col; void main() { - OUT_FragColor0 = vec4(color.rgb, color.a * texture(diffuseMap, texCoord).a); + OUT_col = vec4(color.rgb, color.a * texture(diffuseMap, texCoord).a); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/fixedFunction/gl/colorP.glsl b/Templates/Full/game/shaders/common/fixedFunction/gl/colorP.glsl index 792ee0b5a..f9dfc3d4f 100644 --- a/Templates/Full/game/shaders/common/fixedFunction/gl/colorP.glsl +++ b/Templates/Full/game/shaders/common/fixedFunction/gl/colorP.glsl @@ -22,9 +22,9 @@ in vec4 color; -out vec4 OUT_FragColor0; +out vec4 OUT_col; void main() { - OUT_FragColor0 = color; + OUT_col = color; } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl b/Templates/Full/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl index c2370ee1e..c24b9db12 100644 --- a/Templates/Full/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl +++ b/Templates/Full/game/shaders/common/fixedFunction/gl/modColorTextureP.glsl @@ -24,9 +24,9 @@ uniform sampler2D diffuseMap; in vec4 color; in vec2 texCoord; -out vec4 OUT_FragColor0; +out vec4 OUT_col; void main() { - OUT_FragColor0 = texture(diffuseMap, texCoord) * color; + OUT_col = texture(diffuseMap, texCoord) * color; } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/fixedFunction/gl/textureP.glsl b/Templates/Full/game/shaders/common/fixedFunction/gl/textureP.glsl index 78b0326ba..50cef4bda 100644 --- a/Templates/Full/game/shaders/common/fixedFunction/gl/textureP.glsl +++ b/Templates/Full/game/shaders/common/fixedFunction/gl/textureP.glsl @@ -23,9 +23,9 @@ uniform sampler2D diffuseMap; in vec2 texCoord; -out vec4 OUT_FragColor0; +out vec4 OUT_col; void main() { - OUT_FragColor0 = texture(diffuseMap, texCoord); + OUT_col = texture(diffuseMap, texCoord); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/gl/basicCloudsP.glsl b/Templates/Full/game/shaders/common/gl/basicCloudsP.glsl index ba5801b0f..5b3f50519 100644 --- a/Templates/Full/game/shaders/common/gl/basicCloudsP.glsl +++ b/Templates/Full/game/shaders/common/gl/basicCloudsP.glsl @@ -30,8 +30,10 @@ in vec2 texCoord; uniform sampler2D diffuseMap ; +out vec4 OUT_col; + void main() { vec4 col = texture( diffuseMap, IN_texCoord ); - OUT_FragColor0 = hdrEncode( col ); + OUT_col = hdrEncode( col ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/gl/blurP.glsl b/Templates/Full/game/shaders/common/gl/blurP.glsl index 5c37ebc6b..a27538762 100644 --- a/Templates/Full/game/shaders/common/gl/blurP.glsl +++ b/Templates/Full/game/shaders/common/gl/blurP.glsl @@ -28,10 +28,12 @@ uniform sampler2D diffuseMap; in vec2 texc0, texc1, texc2, texc3; +out vec4 OUT_col; + 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; } diff --git a/Templates/Full/game/shaders/common/gl/cloudLayerP.glsl b/Templates/Full/game/shaders/common/gl/cloudLayerP.glsl index da3996d58..1ab5946f7 100644 --- a/Templates/Full/game/shaders/common/gl/cloudLayerP.glsl +++ b/Templates/Full/game/shaders/common/gl/cloudLayerP.glsl @@ -47,6 +47,8 @@ uniform float cloudCoverage; uniform vec3 cloudBaseColor; uniform float cloudExposure; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Globals //----------------------------------------------------------------------------- @@ -141,5 +143,5 @@ void main() cResultColor.a = mix( cResultColor.a, 0.0, 1.0 - pow(IN_worldDist,2.0) ); - OUT_FragColor0 = cResultColor; + OUT_col = cResultColor; } diff --git a/Templates/Full/game/shaders/common/gl/fxFoliageReplicatorP.glsl b/Templates/Full/game/shaders/common/gl/fxFoliageReplicatorP.glsl index fb5abb91e..b4d591486 100644 --- a/Templates/Full/game/shaders/common/gl/fxFoliageReplicatorP.glsl +++ b/Templates/Full/game/shaders/common/gl/fxFoliageReplicatorP.glsl @@ -29,12 +29,14 @@ uniform vec4 groundAlpha; in vec4 color, groundAlphaCoeff; in vec2 outTexCoord, alphaLookup; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- void main() { 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; } diff --git a/Templates/Full/game/shaders/common/gl/hlslCompat.glsl b/Templates/Full/game/shaders/common/gl/hlslCompat.glsl index 86121f9e6..c8fe73620 100644 --- a/Templates/Full/game/shaders/common/gl/hlslCompat.glsl +++ b/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 void clip(float a) { if(a < 0) discard;} - - out vec4 OUT_col; - #define OUT_FragColor0 OUT_col #endif diff --git a/Templates/Full/game/shaders/common/gl/particleCompositeP.glsl b/Templates/Full/game/shaders/common/gl/particleCompositeP.glsl index 6971e1013..e33c9bd97 100644 --- a/Templates/Full/game/shaders/common/gl/particleCompositeP.glsl +++ b/Templates/Full/game/shaders/common/gl/particleCompositeP.glsl @@ -38,6 +38,7 @@ uniform sampler2D edgeSource; uniform vec4 edgeTargetParams; #endif +out vec4 OUT_col; void main() { @@ -57,5 +58,5 @@ void main() #endif // Sample offscreen target and return - OUT_FragColor0 = texture( colorSource, uvScene.xy ); + OUT_col = texture( colorSource, uvScene.xy ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/gl/particlesP.glsl b/Templates/Full/game/shaders/common/gl/particlesP.glsl index efd930302..813e31a1d 100644 --- a/Templates/Full/game/shaders/common/gl/particlesP.glsl +++ b/Templates/Full/game/shaders/common/gl/particlesP.glsl @@ -78,6 +78,8 @@ vec4 lmSample( vec3 nrm ) uniform float alphaFactor; uniform float alphaScale; +out vec4 OUT_col; + void main() { float softBlend = 1; @@ -100,12 +102,12 @@ void main() 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) 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 ) ); } diff --git a/Templates/Full/game/shaders/common/gl/planarReflectBumpP.glsl b/Templates/Full/game/shaders/common/gl/planarReflectBumpP.glsl index 334c70a70..db4250487 100644 --- a/Templates/Full/game/shaders/common/gl/planarReflectBumpP.glsl +++ b/Templates/Full/game/shaders/common/gl/planarReflectBumpP.glsl @@ -29,6 +29,8 @@ uniform vec4 shadeColor; in vec2 TEX0; in vec4 TEX1; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Fade edges of axis for texcoord passed in //----------------------------------------------------------------------------- @@ -64,5 +66,5 @@ void main() vec4 diffuseColor = texture( diffuseMap, TEX0 ); vec4 reflectColor = textureProj( refractMap, texIndex ); - OUT_FragColor0 = diffuseColor + reflectColor * diffuseColor.a; + OUT_col = diffuseColor + reflectColor * diffuseColor.a; } diff --git a/Templates/Full/game/shaders/common/gl/planarReflectP.glsl b/Templates/Full/game/shaders/common/gl/planarReflectP.glsl index 77914b80e..384c16188 100644 --- a/Templates/Full/game/shaders/common/gl/planarReflectP.glsl +++ b/Templates/Full/game/shaders/common/gl/planarReflectP.glsl @@ -29,6 +29,8 @@ uniform vec4 shadeColor; in vec2 TEX0; in vec4 TEX1; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- @@ -37,5 +39,5 @@ void main() vec4 diffuseColor = texture( diffuseMap, TEX0 ); vec4 reflectColor = textureProj( refractMap, TEX1 ); - OUT_FragColor0 = diffuseColor + reflectColor * diffuseColor.a; + OUT_col = diffuseColor + reflectColor * diffuseColor.a; } diff --git a/Templates/Full/game/shaders/common/gl/precipP.glsl b/Templates/Full/game/shaders/common/gl/precipP.glsl index 3c669517d..102d0b0aa 100644 --- a/Templates/Full/game/shaders/common/gl/precipP.glsl +++ b/Templates/Full/game/shaders/common/gl/precipP.glsl @@ -28,10 +28,12 @@ uniform sampler2D diffuseMap; in vec4 color; in vec2 texCoord; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- void main() { - OUT_FragColor0 = texture(diffuseMap, texCoord) * color; + OUT_col = texture(diffuseMap, texCoord) * color; } diff --git a/Templates/Full/game/shaders/common/gl/projectedShadowP.glsl b/Templates/Full/game/shaders/common/gl/projectedShadowP.glsl index 8ce0fba13..9b0ff0d0b 100644 --- a/Templates/Full/game/shaders/common/gl/projectedShadowP.glsl +++ b/Templates/Full/game/shaders/common/gl/projectedShadowP.glsl @@ -24,7 +24,7 @@ in vec2 texCoord; in vec4 color; in float fade; -out vec4 OUT_FragColor0; +out vec4 OUT_col; uniform sampler2D inputTex; uniform vec4 ambient; @@ -33,5 +33,5 @@ uniform vec4 ambient; void main() { float shadow = texture( inputTex, texCoord ).a * color.a; - OUT_FragColor0 = ( ambient * shadow ) + ( 1 - shadow ); + OUT_col = ( ambient * shadow ) + ( 1 - shadow ); } diff --git a/Templates/Full/game/shaders/common/gl/scatterSkyP.glsl b/Templates/Full/game/shaders/common/gl/scatterSkyP.glsl index 691567a37..d9fa80bcf 100644 --- a/Templates/Full/game/shaders/common/gl/scatterSkyP.glsl +++ b/Templates/Full/game/shaders/common/gl/scatterSkyP.glsl @@ -43,6 +43,8 @@ uniform float useCubemap; uniform vec3 lightDir; uniform vec3 sunDir; +out vec4 OUT_col; + void main() { @@ -62,7 +64,7 @@ void main() float fac = dot( normalize( pos ), sunDir ); 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 // z position of the vertex, passed through @@ -70,6 +72,6 @@ void main() if(zPosition < 0.0) discard; - OUT_FragColor0.a = 1; - OUT_FragColor0 = hdrEncode( OUT_FragColor0 ); + OUT_col.a = 1; + OUT_col = hdrEncode( OUT_col ); } diff --git a/Templates/Full/game/shaders/common/gl/torque.glsl b/Templates/Full/game/shaders/common/gl/torque.glsl index a98ef859f..42965b7c3 100644 --- a/Templates/Full/game/shaders/common/gl/torque.glsl +++ b/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 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. -#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_ diff --git a/Templates/Full/game/shaders/common/gl/wavesP.glsl b/Templates/Full/game/shaders/common/gl/wavesP.glsl index ddb683947..06c8a1a28 100644 --- a/Templates/Full/game/shaders/common/gl/wavesP.glsl +++ b/Templates/Full/game/shaders/common/gl/wavesP.glsl @@ -33,6 +33,8 @@ in vec4 outLightVec; in vec3 outPos; in vec3 outEyePos; +out vec4 OUT_col; + void main() { vec2 texOffset; @@ -45,11 +47,11 @@ void main() vec4 bumpNorm = texture(bumpMap, texOffset) * 2.0 - 1.0; 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 halfAng = normalize(eyeVec + outLightVec.xyz); float specular = clamp(dot(bumpNorm.xyz, halfAng), 0.0, 1.0) * outLightVec.w; specular = pow(specular, specularPower); - OUT_FragColor0 += specularColor * specular; + OUT_col += specularColor * specular; } diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl index e3ee59c8a..7c1754097 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl @@ -27,8 +27,10 @@ in vec2 uv0; uniform sampler2D prepassBuffer; uniform sampler1D depthViz; +out vec4 OUT_col; + void main() { float depth = prepassUncondition( prepassBuffer, uv0 ).w; - OUT_FragColor0 = vec4( texture( depthViz, depth ).rgb, 1.0 ); + OUT_col = vec4( texture( depthViz, depth ).rgb, 1.0 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl index aa17df4d6..05645e193 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl @@ -26,10 +26,12 @@ in vec2 uv0; uniform sampler2D lightInfoBuffer; +out vec4 OUT_col; + void main() { vec3 lightcolor; float nl_Att, specular; lightinfoUncondition( texture( lightInfoBuffer, uv0 ), lightcolor, nl_Att, specular ); - OUT_FragColor0 = vec4( lightcolor, 1.0 ); + OUT_col = vec4( lightcolor, 1.0 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl index e549922ff..7e3e41ee9 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl @@ -26,10 +26,12 @@ in vec2 uv0; uniform sampler2D lightInfoBuffer; +out vec4 OUT_col; + void main() { vec3 lightcolor; float 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 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl index f61706393..dfc611e88 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgNormalVisualizeP.glsl @@ -26,8 +26,10 @@ in vec2 uv0; uniform sampler2D prepassBuffer; +out vec4 OUT_col; + void main() { 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 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl index e997950ab..b51e7310a 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl @@ -25,8 +25,10 @@ in vec2 uv0; uniform sampler2D shadowMap; uniform sampler1D depthViz; +out vec4 OUT_col; + void main() { float depth = saturate( texture( shadowMap, uv0 ).r ); - OUT_FragColor0 = vec4( texture( depthViz, depth ).rgb, 1 ); + OUT_col = vec4( texture( depthViz, depth ).rgb, 1 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/pointLightP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/pointLightP.glsl index c0610508b..e70f68a43 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/pointLightP.glsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/gl/pointLightP.glsl @@ -121,7 +121,8 @@ uniform vec4 vsFarPlane; uniform mat3 viewToLightProj; uniform vec4 lightParams; uniform float shadowSoftness; - + +out vec4 OUT_col; void main() { @@ -229,5 +230,5 @@ void main() addToResult = ( 1.0 - shadowed ) * abs(lightMapParams); } - OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); + OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); } diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/spotLightP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/spotLightP.glsl index c07be1f34..b3920ec9a 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/spotLightP.glsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/gl/spotLightP.glsl @@ -63,6 +63,8 @@ uniform mat4 viewToLightProj; uniform vec4 lightParams; uniform float shadowSoftness; +out vec4 OUT_col; + void main() { // Compute scene UV @@ -162,5 +164,5 @@ void main() addToResult = ( 1.0 - shadowed ) * abs(lightMapParams); } - OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); + OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); } diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl index 0178c35ea..42e46f2dc 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/gl/vectorLightP.glsl @@ -62,6 +62,8 @@ uniform vec4 farPlaneScalePSSM; uniform vec4 overDarkPSSM; uniform float shadowSoftness; +out vec4 OUT_col; + void main() { // Sample/unpack the normal/z data @@ -227,6 +229,6 @@ void main() lightColorOut = debugColor; #endif - OUT_FragColor0 = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); + OUT_col = lightinfoCondition( lightColorOut, Sat_NL_Att, specular, addToResult ); } diff --git a/Templates/Full/game/shaders/common/lighting/basic/gl/shadowFilterP.glsl b/Templates/Full/game/shaders/common/lighting/basic/gl/shadowFilterP.glsl index 4e97fa347..9b510e0cf 100644 --- a/Templates/Full/game/shaders/common/lighting/basic/gl/shadowFilterP.glsl +++ b/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 weight[3] = float[]( 0.2270270270, 0.3162162162, 0.0702702703 ); +out vec4 OUT_col; + void main() { - vec4 OUT = texture( diffuseMap, uv ) * weight[0]; + OUT_col = texture( diffuseMap, uv ) * weight[0]; for ( int i=1; i < 3; i++ ) { 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; } diff --git a/Templates/Full/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl b/Templates/Full/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl index 0f568c716..d4e05132b 100644 --- a/Templates/Full/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl +++ b/Templates/Full/game/shaders/common/lighting/shadowMap/gl/boxFilterP.glsl @@ -28,6 +28,8 @@ uniform vec2 blurDimension; in vec2 tex0; +out vec4 OUT_col; + void main() { // Preshader @@ -43,5 +45,5 @@ void main() accum += texture(diffuseMap0, BaseTexCoord + float(i) * SampleOffset); } accum /= blurSamples; - OUT_FragColor0 = accum; + OUT_col = accum; } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/caustics/gl/causticsP.glsl b/Templates/Full/game/shaders/common/postFx/caustics/gl/causticsP.glsl index 6f5d68c87..2d2a54154 100644 --- a/Templates/Full/game/shaders/common/postFx/caustics/gl/causticsP.glsl +++ b/Templates/Full/game/shaders/common/postFx/caustics/gl/causticsP.glsl @@ -34,6 +34,8 @@ uniform sampler2D causticsTex0; uniform sampler2D causticsTex1; uniform vec2 targetSize; +out vec4 OUT_col; + float distanceToPlane(vec4 plane, vec3 pos) { 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; if(depth > 0.9999) { - OUT_FragColor0 = vec4(0,0,0,0); + OUT_col = vec4(0,0,0,0); return; } @@ -59,7 +61,7 @@ void main() float waterDepth = -distanceToPlane(waterFogPlane, pos); if(waterDepth < 0) { - OUT_FragColor0 = vec4(0,0,0,0); + OUT_col = vec4(0,0,0,0); return; } waterDepth = saturate(waterDepth); @@ -81,5 +83,5 @@ void main() //float waterDepth = 1 - saturate(pos.z + waterFogPlane.w + 1); caustics *= saturate(prePass.z) * pow(1-depth, 64) * waterDepth; - OUT_FragColor0 = caustics; + OUT_col = caustics; } diff --git a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl b/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl index af3ce91f4..38cb099c4 100644 --- a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl +++ b/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_CalcCoC_P.glsl @@ -27,6 +27,8 @@ uniform sampler2D shrunkSampler; // Output of DofDownsample() uniform sampler2D blurredSampler; // Blurred version of the shrunk sampler +out vec4 OUT_col; + // This is the pixel shader function that calculates the actual // value used for the near circle of confusion. // "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; - //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 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl b/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl index b81a6ac92..6b7cf4eca 100644 --- a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl +++ b/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl @@ -47,6 +47,8 @@ in vec2 tcDepth2; in vec2 tcDepth3; #define IN_tcDepth3 tcDepth3 +out vec4 OUT_col; + void main() { //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] ) ); - //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 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_Final_P.glsl b/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_Final_P.glsl index 2adcfae7a..40b71bc27 100644 --- a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_Final_P.glsl +++ b/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 vec3 dofEqFar = vec3( 2.0, 0.0, 1.0 ); +out vec4 OUT_col; + vec4 tex2Doffset( sampler2D s, vec2 tc, vec2 offset ) { return texture( s, tc + offset * oneOverTargetSize ); @@ -141,5 +143,5 @@ void main() //return half4(nearCoc.rrr,1); //return half4( 1,0,1,0 ); - OUT_FragColor0 = InterpolateDof( small, med.rgb, large, coc ); + OUT_col = InterpolateDof( small, med.rgb, large, coc ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_Gausian_P.glsl b/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_Gausian_P.glsl index 979caced6..61e7697af 100644 --- a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_Gausian_P.glsl +++ b/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_Gausian_P.glsl @@ -42,7 +42,7 @@ in vec2 uv6; in vec2 uv7; #define IN_uv7 uv7 -#define OUT OUT_FragColor0 +out vec4 OUT_col; 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; - 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 // can use alpha test to save fillrate. //vec3 rgb2lum = vec3( 0.30, 0.59, 0.11 ); - //OUT.a = dot( OUT.rgb, rgb2lum ); + //OUT_col.a = dot( OUT_col.rgb, rgb2lum ); } diff --git a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_SmallBlur_P.glsl b/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_SmallBlur_P.glsl index a6d1ecabc..ae94edd78 100644 --- a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_SmallBlur_P.glsl +++ b/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_SmallBlur_P.glsl @@ -32,6 +32,8 @@ uniform sampler2D colorSampler; // Output of DofNearCoc() in vec4 texCoords; #define IN_texCoords texCoords +out vec4 OUT_col; + void main() { vec4 color; @@ -40,5 +42,5 @@ void main() color += texture( colorSampler, IN_texCoords.yz ); color += texture( colorSampler, IN_texCoords.xw ); color += texture( colorSampler, IN_texCoords.yw ); - OUT_FragColor0 = color / 4.0; + OUT_col = color / 4.0; } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/edgeaa/gl/dbgEdgeDisplayP.glsl b/Templates/Full/game/shaders/common/postFx/edgeaa/gl/dbgEdgeDisplayP.glsl index d02e3b825..ccc3b8ba5 100644 --- a/Templates/Full/game/shaders/common/postFx/edgeaa/gl/dbgEdgeDisplayP.glsl +++ b/Templates/Full/game/shaders/common/postFx/edgeaa/gl/dbgEdgeDisplayP.glsl @@ -28,7 +28,9 @@ in vec2 uv0; uniform sampler2D edgeBuffer; +out vec4 OUT_col; + void main() { - OUT_FragColor0 = vec4( texture( edgeBuffer, IN_uv0 ).rrr, 1.0 ); + OUT_col = vec4( texture( edgeBuffer, IN_uv0 ).rrr, 1.0 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/edgeaa/gl/edgeAAP.glsl b/Templates/Full/game/shaders/common/postFx/edgeaa/gl/edgeAAP.glsl index e43c69bc1..216dc8725 100644 --- a/Templates/Full/game/shaders/common/postFx/edgeaa/gl/edgeAAP.glsl +++ b/Templates/Full/game/shaders/common/postFx/edgeaa/gl/edgeAAP.glsl @@ -28,6 +28,8 @@ uniform sampler2D edgeBuffer; uniform sampler2D backBuffer; uniform vec2 targetSize; +out vec4 OUT_col; + void main() { vec2 pixelSize = 1.0 / targetSize; @@ -64,5 +66,5 @@ void main() } accumColor /= 9.0; - OUT_FragColor0 = accumColor; + OUT_col = accumColor; } diff --git a/Templates/Full/game/shaders/common/postFx/edgeaa/gl/edgeDetectP.glsl b/Templates/Full/game/shaders/common/postFx/edgeaa/gl/edgeDetectP.glsl index 26dc26e8f..d1856ecde 100644 --- a/Templates/Full/game/shaders/common/postFx/edgeaa/gl/edgeDetectP.glsl +++ b/Templates/Full/game/shaders/common/postFx/edgeaa/gl/edgeDetectP.glsl @@ -88,7 +88,9 @@ in vec2 uv0; uniform sampler2D prepassBuffer; uniform vec2 targetSize; +out vec4 OUT_col; + void main() { - OUT_FragColor0 = vec4( GetEdgeWeight(IN_uv0, prepassBuffer, targetSize ) );//rtWidthHeightInvWidthNegHeight.zw); + OUT_col = vec4( GetEdgeWeight(IN_uv0, prepassBuffer, targetSize ) );//rtWidthHeightInvWidthNegHeight.zw); } diff --git a/Templates/Full/game/shaders/common/postFx/fxaa/gl/fxaaP.glsl b/Templates/Full/game/shaders/common/postFx/fxaa/gl/fxaaP.glsl index e15671564..19d76ef42 100644 --- a/Templates/Full/game/shaders/common/postFx/fxaa/gl/fxaaP.glsl +++ b/Templates/Full/game/shaders/common/postFx/fxaa/gl/fxaaP.glsl @@ -34,9 +34,11 @@ uniform vec2 oneOverTargetSize; in vec4 hpos; in vec2 uv0; +out vec4 OUT_col; + void main() { - OUT_FragColor0 = FxaaPixelShader( + OUT_col = FxaaPixelShader( uv0, // vertex position diff --git a/Templates/Full/game/shaders/common/postFx/gl/chromaticLens.glsl b/Templates/Full/game/shaders/common/postFx/gl/chromaticLens.glsl index 4e04aabbb..0c02c3742 100644 --- a/Templates/Full/game/shaders/common/postFx/gl/chromaticLens.glsl +++ b/Templates/Full/game/shaders/common/postFx/gl/chromaticLens.glsl @@ -32,6 +32,8 @@ uniform float distCoeff; uniform float cubeDistort; uniform vec3 colorDistort; +out vec4 OUT_col; + void main() { vec2 tex = IN_uv0; @@ -56,5 +58,5 @@ void main() outColor[i] = tex2Dlod( backBuffer, vec4(x,y,0,0) )[i]; } - OUT_FragColor0 = vec4( outColor.rgb, 1 ); + OUT_col = vec4( outColor.rgb, 1 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/gl/flashP.glsl b/Templates/Full/game/shaders/common/postFx/gl/flashP.glsl index d03665fe2..a287a135f 100644 --- a/Templates/Full/game/shaders/common/postFx/gl/flashP.glsl +++ b/Templates/Full/game/shaders/common/postFx/gl/flashP.glsl @@ -28,10 +28,12 @@ uniform float damageFlash; uniform float whiteOut; uniform sampler2D backBuffer; +out vec4 OUT_col; + void main() { vec4 color1 = texture(backBuffer, IN_uv0); vec4 color2 = color1 * MUL_COLOR; vec4 damage = mix(color1,color2,damageFlash); - OUT_FragColor0 = mix(damage,WHITE_COLOR,whiteOut); + OUT_col = mix(damage,WHITE_COLOR,whiteOut); } diff --git a/Templates/Full/game/shaders/common/postFx/gl/fogP.glsl b/Templates/Full/game/shaders/common/postFx/gl/fogP.glsl index aff559f78..7b0d71933 100644 --- a/Templates/Full/game/shaders/common/postFx/gl/fogP.glsl +++ b/Templates/Full/game/shaders/common/postFx/gl/fogP.glsl @@ -34,6 +34,8 @@ uniform vec4 rtParams0; in vec2 uv0; in vec3 wsEyeRay; +out vec4 OUT_col; + void main() { //vec2 prepassCoord = ( uv0.xy * rtParams0.zw ) + rtParams0.xy; @@ -46,5 +48,5 @@ void main() fogData.y, fogData.z ); - OUT_FragColor0 = hdrEncode( vec4( fogColor.rgb, 1.0 - saturate( factor ) ) ); + OUT_col = hdrEncode( vec4( fogColor.rgb, 1.0 - saturate( factor ) ) ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/gl/gammaP.glsl b/Templates/Full/game/shaders/common/postFx/gl/gammaP.glsl index c27dbb042..414a277d3 100644 --- a/Templates/Full/game/shaders/common/postFx/gl/gammaP.glsl +++ b/Templates/Full/game/shaders/common/postFx/gl/gammaP.glsl @@ -31,6 +31,8 @@ uniform float OneOverGamma; in vec2 uv0; +out vec4 OUT_col; + void main() { vec4 color = texture(backBuffer, uv0.xy); @@ -43,5 +45,5 @@ void main() // Apply gamma correction color.rgb = pow( abs(color.rgb), vec3(OneOverGamma) ); - OUT_FragColor0 = color; + OUT_col = color; } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/gl/glowBlurP.glsl b/Templates/Full/game/shaders/common/postFx/gl/glowBlurP.glsl index 4cb777f3f..0a70fb6aa 100644 --- a/Templates/Full/game/shaders/common/postFx/gl/glowBlurP.glsl +++ b/Templates/Full/game/shaders/common/postFx/gl/glowBlurP.glsl @@ -34,25 +34,26 @@ in vec2 uv5; //TEXCOORD5; in vec2 uv6; //TEXCOORD6; in vec2 uv7; //TEXCOORD7; +out vec4 OUT_col; + void main() { 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; + 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 += texture( diffuseMap, uv4 ) * kernel.x; - OUT += texture( diffuseMap, uv5 ) * kernel.y; - OUT += texture( diffuseMap, uv6 ) * kernel.z; - OUT += texture( diffuseMap, uv7 ) * 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 // can use alpha test to save fillrate. vec3 rgb2lum = vec3( 0.30, 0.59, 0.11 ); - OUT.a = dot( OUT.rgb, rgb2lum ); + OUT_col.a = dot( OUT_col.rgb, rgb2lum ); - OUT_FragColor0 = OUT; } diff --git a/Templates/Full/game/shaders/common/postFx/gl/motionBlurP.glsl b/Templates/Full/game/shaders/common/postFx/gl/motionBlurP.glsl index e46547d19..56333e776 100644 --- a/Templates/Full/game/shaders/common/postFx/gl/motionBlurP.glsl +++ b/Templates/Full/game/shaders/common/postFx/gl/motionBlurP.glsl @@ -37,6 +37,8 @@ uniform float velocityMultiplier; uniform sampler2D backBuffer; uniform sampler2D prepassTex; +out vec4 OUT_col; + void main() { vec2 IN_uv0 = _IN_uv0; @@ -72,5 +74,5 @@ void main() color += currentColor; } - OUT_FragColor0 = color / samples; + OUT_col = color / samples; } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/gl/passthruP.glsl b/Templates/Full/game/shaders/common/postFx/gl/passthruP.glsl index 599d4a177..47a1e4eaf 100644 --- a/Templates/Full/game/shaders/common/postFx/gl/passthruP.glsl +++ b/Templates/Full/game/shaders/common/postFx/gl/passthruP.glsl @@ -25,7 +25,9 @@ in vec2 uv0; uniform sampler2D inputTex ; +out vec4 OUT_col; + void main() { - OUT_FragColor0 = texture( inputTex, uv0 ); + OUT_col = texture( inputTex, uv0 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/gl/turbulenceP.glsl b/Templates/Full/game/shaders/common/postFx/gl/turbulenceP.glsl index 790742bf2..9b97d971d 100644 --- a/Templates/Full/game/shaders/common/postFx/gl/turbulenceP.glsl +++ b/Templates/Full/game/shaders/common/postFx/gl/turbulenceP.glsl @@ -34,6 +34,8 @@ in vec2 uv0; #define IN_uv0 uv0 +out vec4 OUT_col; + void main() { float speed = 2.0; @@ -46,5 +48,5 @@ void main() y = clamp(y, targetViewport.y, targetViewport.w); x = clamp(x, targetViewport.x, targetViewport.z); - OUT_FragColor0 = texture (inputTex, vec2(x, y)); + OUT_col = texture (inputTex, vec2(x, y)); } diff --git a/Templates/Full/game/shaders/common/postFx/gl/underwaterFogP.glsl b/Templates/Full/game/shaders/common/postFx/gl/underwaterFogP.glsl index 864942f71..33cfae7bd 100644 --- a/Templates/Full/game/shaders/common/postFx/gl/underwaterFogP.glsl +++ b/Templates/Full/game/shaders/common/postFx/gl/underwaterFogP.glsl @@ -51,6 +51,8 @@ uniform vec2 nearFar; uniform vec4 rtParams0; uniform float waterDepthGradMax; +out vec4 OUT_col; + void main() { //vec2 prepassCoord = IN_uv0; @@ -134,5 +136,5 @@ void main() vec3 outColor = mix( inColor, fogColor.rgb, fogAmt ); - OUT_FragColor0 = vec4( hdrEncode( outColor ), 1 ); + OUT_col = vec4( hdrEncode( outColor ), 1 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/hdr/gl/bloomGaussBlurHP.glsl b/Templates/Full/game/shaders/common/postFx/hdr/gl/bloomGaussBlurHP.glsl index 37780d073..1d9a2df3e 100644 --- a/Templates/Full/game/shaders/common/postFx/hdr/gl/bloomGaussBlurHP.glsl +++ b/Templates/Full/game/shaders/common/postFx/hdr/gl/bloomGaussBlurHP.glsl @@ -30,6 +30,8 @@ uniform float gaussMultiplier; uniform float gaussMean; uniform float gaussStdDev; +out vec4 OUT_col; + #define PI 3.141592654 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 ); } - OUT_FragColor0 = vec4( color.rgb, 1.0f ); + OUT_col = vec4( color.rgb, 1.0f ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/hdr/gl/bloomGaussBlurVP.glsl b/Templates/Full/game/shaders/common/postFx/hdr/gl/bloomGaussBlurVP.glsl index f236186b7..68f34b164 100644 --- a/Templates/Full/game/shaders/common/postFx/hdr/gl/bloomGaussBlurVP.glsl +++ b/Templates/Full/game/shaders/common/postFx/hdr/gl/bloomGaussBlurVP.glsl @@ -30,6 +30,8 @@ uniform float gaussMultiplier; uniform float gaussMean; uniform float gaussStdDev; +out vec4 OUT_col; + #define D3DX_PI 3.141592654 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 ); } - OUT_FragColor0 = vec4( color.rgb, 1.0f ); + OUT_col = vec4( color.rgb, 1.0f ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/hdr/gl/brightPassFilterP.glsl b/Templates/Full/game/shaders/common/postFx/hdr/gl/brightPassFilterP.glsl index 4649e8559..f220ca1e7 100644 --- a/Templates/Full/game/shaders/common/postFx/hdr/gl/brightPassFilterP.glsl +++ b/Templates/Full/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); +out vec4 OUT_col; + const vec2 gTapOffsets[4] = vec2[] ( @@ -59,5 +61,5 @@ void main() average = vec4( 0.0f, 0.0f, 0.0f, 1.0f ); // Write the colour to the bright-pass render target - OUT_FragColor0 = hdrEncode( average ); + OUT_col = hdrEncode( average ); } diff --git a/Templates/Full/game/shaders/common/postFx/hdr/gl/calculateAdaptedLumP.glsl b/Templates/Full/game/shaders/common/postFx/hdr/gl/calculateAdaptedLumP.glsl index ac883c54e..96ee9d6df 100644 --- a/Templates/Full/game/shaders/common/postFx/hdr/gl/calculateAdaptedLumP.glsl +++ b/Templates/Full/game/shaders/common/postFx/hdr/gl/calculateAdaptedLumP.glsl @@ -30,6 +30,8 @@ uniform sampler2D lastAdaptedLum; uniform float adaptRate; uniform float deltaTime; +out vec4 OUT_col; + void main() { float fAdaptedLum = texture( lastAdaptedLum, vec2(0.5f, 0.5f) ).r; @@ -42,5 +44,5 @@ void main() float diff = fCurrentLum - fAdaptedLum; 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 ); } diff --git a/Templates/Full/game/shaders/common/postFx/hdr/gl/downScale4x4P.glsl b/Templates/Full/game/shaders/common/postFx/hdr/gl/downScale4x4P.glsl index 77b378ac8..131671760 100644 --- a/Templates/Full/game/shaders/common/postFx/hdr/gl/downScale4x4P.glsl +++ b/Templates/Full/game/shaders/common/postFx/hdr/gl/downScale4x4P.glsl @@ -30,6 +30,8 @@ in vec4 texCoords[8]; uniform sampler2D inputTex; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- @@ -44,5 +46,5 @@ void main() _sample += texture( inputTex, IN_texCoords[i].zw ); } - OUT_FragColor0 = _sample / 16; + OUT_col = _sample / 16; } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/hdr/gl/finalPassCombineP.glsl b/Templates/Full/game/shaders/common/postFx/hdr/gl/finalPassCombineP.glsl index ddc2fe4fd..38762baa5 100644 --- a/Templates/Full/game/shaders/common/postFx/hdr/gl/finalPassCombineP.glsl +++ b/Templates/Full/game/shaders/common/postFx/hdr/gl/finalPassCombineP.glsl @@ -43,6 +43,8 @@ uniform float g_fBloomScale; uniform float g_fOneOverGamma; +out vec4 OUT_col; + void main() { @@ -92,5 +94,5 @@ void main() // Apply gamma correction _sample.rgb = pow( abs(_sample.rgb), vec3(g_fOneOverGamma) ); - OUT_FragColor0 = _sample; + OUT_col = _sample; } diff --git a/Templates/Full/game/shaders/common/postFx/hdr/gl/luminanceVisP.glsl b/Templates/Full/game/shaders/common/postFx/hdr/gl/luminanceVisP.glsl index d389b4125..ee9c28c87 100644 --- a/Templates/Full/game/shaders/common/postFx/hdr/gl/luminanceVisP.glsl +++ b/Templates/Full/game/shaders/common/postFx/hdr/gl/luminanceVisP.glsl @@ -28,6 +28,8 @@ uniform sampler2D inputTex; uniform float brightPassThreshold; +out vec4 OUT_col; + void main() { vec4 _sample = hdrDecode( texture( inputTex, IN_uv0 ) ); @@ -36,5 +38,5 @@ void main() float lum = hdrLuminance( _sample.rgb ); // Write the colour to the bright-pass render target - OUT_FragColor0 = ( vec4( lum.rrr, 1 ) ); + OUT_col = ( vec4( lum.rrr, 1 ) ); } diff --git a/Templates/Full/game/shaders/common/postFx/hdr/gl/sampleLumInitialP.glsl b/Templates/Full/game/shaders/common/postFx/hdr/gl/sampleLumInitialP.glsl index 218cb455f..8a2b9b318 100644 --- a/Templates/Full/game/shaders/common/postFx/hdr/gl/sampleLumInitialP.glsl +++ b/Templates/Full/game/shaders/common/postFx/hdr/gl/sampleLumInitialP.glsl @@ -29,6 +29,8 @@ uniform vec2 texSize0; uniform float g_fMinLuminace; +out vec4 OUT_col; + const vec2 gTapOffsets[9] = vec2[] ( 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 ); - OUT_FragColor0 = vec4( average, 0.0, 0.0, 1.0 ); + OUT_col = vec4( average, 0.0, 0.0, 1.0 ); } diff --git a/Templates/Full/game/shaders/common/postFx/hdr/gl/sampleLumIterativeP.glsl b/Templates/Full/game/shaders/common/postFx/hdr/gl/sampleLumIterativeP.glsl index 9550f1cf1..2e800d612 100644 --- a/Templates/Full/game/shaders/common/postFx/hdr/gl/sampleLumIterativeP.glsl +++ b/Templates/Full/game/shaders/common/postFx/hdr/gl/sampleLumIterativeP.glsl @@ -26,6 +26,7 @@ uniform sampler2D inputTex; uniform vec2 oneOverTargetSize; +out vec4 OUT_col; const vec2 gTapOffsets[16] = vec2[] ( @@ -47,5 +48,5 @@ void main() 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 ); } diff --git a/Templates/Full/game/shaders/common/postFx/lightRay/gl/lightRayOccludeP.glsl b/Templates/Full/game/shaders/common/postFx/lightRay/gl/lightRayOccludeP.glsl index 8635e843c..01c7658aa 100644 --- a/Templates/Full/game/shaders/common/postFx/lightRay/gl/lightRayOccludeP.glsl +++ b/Templates/Full/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); +out vec4 OUT_col; void main() { @@ -50,5 +51,5 @@ void main() col *= brightScalar; } - OUT_FragColor0 = col; + OUT_col = col; } diff --git a/Templates/Full/game/shaders/common/postFx/lightRay/gl/lightRayP.glsl b/Templates/Full/game/shaders/common/postFx/lightRay/gl/lightRayP.glsl index 9575b8de0..4e06edb4b 100644 --- a/Templates/Full/game/shaders/common/postFx/lightRay/gl/lightRayP.glsl +++ b/Templates/Full/game/shaders/common/postFx/lightRay/gl/lightRayP.glsl @@ -36,6 +36,8 @@ uniform float weight; uniform float decay; uniform float exposure; +out vec4 OUT_col; + void main() { vec4 texCoord = vec4( IN_uv0.xy, 0, 0 ); @@ -55,7 +57,7 @@ void main() if ( samples <= 0 ) { - OUT_FragColor0 = bbCol; + OUT_col = bbCol; return; } @@ -88,5 +90,5 @@ void main() //return bbCol * decay; // 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; } diff --git a/Templates/Full/game/shaders/common/postFx/mlaa/gl/blendWeightCalculationP.glsl b/Templates/Full/game/shaders/common/postFx/mlaa/gl/blendWeightCalculationP.glsl index 85bfff633..af01ce6f9 100644 --- a/Templates/Full/game/shaders/common/postFx/mlaa/gl/blendWeightCalculationP.glsl +++ b/Templates/Full/game/shaders/common/postFx/mlaa/gl/blendWeightCalculationP.glsl @@ -34,6 +34,8 @@ uniform sampler2D edgesMap; uniform sampler2D edgesMapL; uniform sampler2D areaMap; +out vec4 OUT_col; + #include "./functions.glsl" @@ -77,5 +79,5 @@ void main() areas.ba = Area(abs(d), e1, e2); } - OUT_FragColor0 = areas; + OUT_col = areas; } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/mlaa/gl/edgeDetectionP.glsl b/Templates/Full/game/shaders/common/postFx/mlaa/gl/edgeDetectionP.glsl index 7e59fa1de..362f29b5c 100644 --- a/Templates/Full/game/shaders/common/postFx/mlaa/gl/edgeDetectionP.glsl +++ b/Templates/Full/game/shaders/common/postFx/mlaa/gl/edgeDetectionP.glsl @@ -39,6 +39,8 @@ uniform float depthThreshold; in vec2 texcoord; in vec4 offset[2]; +out vec4 OUT_col; + void main() { // Luma calculation requires gamma-corrected colors (texture 'colorMapG'). @@ -70,5 +72,5 @@ void main() if (dot(edges, vec4(1.0)) == 0.0) discard; - OUT_FragColor0 = edges; + OUT_col = edges; } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/mlaa/gl/neighborhoodBlendingP.glsl b/Templates/Full/game/shaders/common/postFx/mlaa/gl/neighborhoodBlendingP.glsl index bba266930..eddbcc47c 100644 --- a/Templates/Full/game/shaders/common/postFx/mlaa/gl/neighborhoodBlendingP.glsl +++ b/Templates/Full/game/shaders/common/postFx/mlaa/gl/neighborhoodBlendingP.glsl @@ -40,6 +40,7 @@ uniform sampler2D areaMap; uniform sampler2D edgesMapL; #include "./functions.glsl" +out vec4 OUT_col; void main() { @@ -83,5 +84,5 @@ void main() #endif // Normalize the resulting color and we are finished! - OUT_FragColor0 = color / sum; + OUT_col = color / sum; } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_Blur_P.glsl b/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_Blur_P.glsl index 9e9f58d99..f0de9396f 100644 --- a/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_Blur_P.glsl +++ b/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_Blur_P.glsl @@ -46,6 +46,7 @@ uniform sampler2D prepassMap ; uniform float blurDepthTol; uniform float blurNormalTol; +out vec4 OUT_col; 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 /= total; - OUT_FragColor0 = vec4( vec3(occlusion), 1 ); + OUT_col = vec4( vec3(occlusion), 1 ); //return vec4( 0,0,0,occlusion ); diff --git a/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_P.glsl b/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_P.glsl index 0d0e5c7b2..7ee6a412a 100644 --- a/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_P.glsl +++ b/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_P.glsl @@ -57,6 +57,8 @@ uniform float lDepthPow; uniform float lNormalTol; uniform float lNormalPow; +out vec4 OUT_col; + #ifndef QUALITY #define QUALITY 2 @@ -152,7 +154,7 @@ void main() // Early out if too far away. if ( depth > 0.99999999 ) { - OUT_FragColor0 = vec4( 0,0,0,0 ); + OUT_col = vec4( 0,0,0,0 ); return; } @@ -270,7 +272,7 @@ void main() // seems backwards, but it makes it simple to deal with the SSAO // being disabled in the lighting shaders. - OUT_FragColor0 = vec4(occlusion, vec3(0.0)); + OUT_col = vec4(occlusion, vec3(0.0)); } diff --git a/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_PowerTable_P.glsl b/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_PowerTable_P.glsl index 49374bf70..4f49479ba 100644 --- a/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_PowerTable_P.glsl +++ b/Templates/Full/game/shaders/common/postFx/ssao/gl/SSAO_PowerTable_P.glsl @@ -25,8 +25,10 @@ in vec2 uv0; #define IN_uv0 uv0 +out vec4 OUT_col; + void main() { float power = pow( max( IN_uv0.x, 0 ), 0.1 ); - OUT_FragColor0 = vec4( power, 0, 0, 1 ); + OUT_col = vec4( power, 0, 0, 1 ); } \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/terrain/gl/blendP.glsl b/Templates/Full/game/shaders/common/terrain/gl/blendP.glsl index a2e4af787..3189ea01d 100644 --- a/Templates/Full/game/shaders/common/terrain/gl/blendP.glsl +++ b/Templates/Full/game/shaders/common/terrain/gl/blendP.glsl @@ -33,6 +33,8 @@ uniform sampler2D textureMap; uniform float texId; uniform float layerSize; +out vec4 OUT_col; + void main() { vec4 layerSample = round(texture( layerTex, IN_layerCoord ) * 255.0); @@ -42,5 +44,5 @@ void main() if(blend - 0.0001 < 0.0) discard; - OUT_FragColor0 = vec4( texture( textureMap, IN_texCoord ).rgb, blend ); + OUT_col = vec4( texture( textureMap, IN_texCoord ).rgb, blend ); } diff --git a/Templates/Full/game/shaders/common/water/gl/waterBasicP.glsl b/Templates/Full/game/shaders/common/water/gl/waterBasicP.glsl index 44207dea9..f84a8feb4 100644 --- a/Templates/Full/game/shaders/common/water/gl/waterBasicP.glsl +++ b/Templates/Full/game/shaders/common/water/gl/waterBasicP.glsl @@ -111,6 +111,8 @@ uniform vec4 rippleMagnitude; uniform vec4 specularParams; uniform mat4 modelMat; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- @@ -136,7 +138,7 @@ void main() distortPos.xy += bumpNorm.xy * distortAmt; #ifdef UNDERWATER - OUT_FragColor0 = hdrEncode( textureProj( refractBuff, distortPos ) ); + OUT_col = hdrEncode( textureProj( refractBuff, distortPos ) ); #else vec3 eyeVec = IN_objPos.xyz - eyePos; @@ -208,7 +210,7 @@ void main() #endif - OUT_FragColor0 = OUT; + OUT_col = OUT; #endif } diff --git a/Templates/Full/game/shaders/common/water/gl/waterP.glsl b/Templates/Full/game/shaders/common/water/gl/waterP.glsl index 3e15fe576..af151020a 100644 --- a/Templates/Full/game/shaders/common/water/gl/waterP.glsl +++ b/Templates/Full/game/shaders/common/water/gl/waterP.glsl @@ -145,6 +145,8 @@ uniform vec4 sunColor; uniform float sunBrightness; uniform float reflectivity; +out vec4 OUT_col; + //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- @@ -390,5 +392,5 @@ void main() //return OUT; - OUT_FragColor0 = hdrEncode( OUT ); + OUT_col = hdrEncode( OUT ); }