<Shader>
<Context id="BLURH">
<RenderConfig writeDepth="false" />
<VertexShader>
<DefCode>
<![CDATA[
varying vec2 texCoord;
void main( void )
{
texCoord = gl_MultiTexCoord0.st;
gl_Position = gl_ProjectionMatrix * gl_Vertex;
}
]]>
</DefCode>
</VertexShader>
<FragmentShader>
<InsCode code="utilityLib/fragPostProcess.glsl" />
<DefCode>
<![CDATA[
uniform sampler2D tex;
uniform vec2 frameBufSize;
varying vec2 texCoord;
void main( void )
{
float halfPixel = 0.5 / frameBufSize.x;
vec4 col = texture2D( tex, texCoord + vec2( halfPixel, 0.0 ) );
col += texture2D( tex, texCoord - vec2( halfPixel, 0.0 ) );
col += texture2D( tex, texCoord + vec2( halfPixel*3.0, 0.0 ) );
col += texture2D( tex, texCoord - vec2( halfPixel*3.0, 0.0 ) );
gl_FragColor = col * 0.25;
}
]]>
</DefCode>
</FragmentShader>
</Context>
<Context id="BLURV">
<RenderConfig writeDepth="false" />
<VertexShader>
<DefCode>
<![CDATA[
varying vec2 texCoord;
void main( void )
{
texCoord = gl_MultiTexCoord0.st;
gl_Position = gl_ProjectionMatrix * gl_Vertex;
}
]]>
</DefCode>
</VertexShader>
<FragmentShader>
<InsCode code="utilityLib/fragPostProcess.glsl" />
<DefCode>
<![CDATA[
uniform sampler2D tex;
uniform vec2 frameBufSize;
varying vec2 texCoord;
void main( void )
{
float halfPixel = 0.5 / frameBufSize.y;
vec4 col = texture2D( tex, texCoord + vec2( 0.0, halfPixel ) );
col += texture2D( tex, texCoord - vec2( 0.0, halfPixel ) );
col += texture2D( tex, texCoord + vec2( 0.0, halfPixel*3.0 ) );
col += texture2D( tex, texCoord - vec2( 0.0, halfPixel*3.0 ) );
gl_FragColor = col * 0.25;
}
]]>
</DefCode>
</FragmentShader>
</Context>
<Context id="FINALPASS">
<RenderConfig writeDepth="false" blendMode="ADD" />
<VertexShader>
<DefCode>
<![CDATA[
varying vec2 texCoord;
void main( void )
{
texCoord = gl_MultiTexCoord0.st;
gl_Position = gl_ProjectionMatrix * gl_Vertex;
}
]]>
</DefCode>
</VertexShader>
<FragmentShader>
<DefCode>
<![CDATA[
uniform sampler2D tex0, tex1;
uniform vec2 frameBufSize;
uniform vec4 hdrParams;
varying vec2 texCoord;
void main( void )
{
gl_FragColor = texture2D( tex0, texCoord ); // Glow color
}
]]>
</DefCode>
</FragmentShader>
</Context>
</Shader>