Clean GLSL fragment shader out.

This commit is contained in:
LuisAntonRebollo 2014-11-30 22:56:30 +01:00
parent 87f34e3c4f
commit ed0febea39
135 changed files with 451 additions and 239 deletions

View file

@ -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 );
}

View file

@ -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 );
}

View file

@ -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 );
}

View file

@ -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 );
}

View file

@ -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 );
}

View file

@ -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 );
}

View file

@ -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 );
}

View file

@ -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 );
}