Sepia shader
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 Color = texture2D( gm_BaseTexture, v_vTexcoord );
vec3 lum = vec3(0.299, 0.587, 0.114);
float bw = dot( Color.rgb, lum);//black and white result
gl_FragColor = vec4( vec3(bw,0.0,0.0), Color.a);
}
The result is this:
As you can see, that doesn't look like a sepia shader. It should have more green and a little more blue. Right now, it only has the red. So we will try a different vector so that there is still some green and blue. I found that the vector "vec3( 1.0, 0.8, 0.4)" was my favorite, though if you wanted you could tweak it. The code I used looks like this:
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 Color = texture2D( gm_BaseTexture, v_vTexcoord );
vec3 lum = vec3(0.299, 0.587, 0.114);
float bw = dot( Color.rgb, lum);//black and white result
gl_FragColor = vec4( bw * vec3( 1.0, 0.8, 0.4), Color.a);
}
Here are the results:
Next will test another simple shader.
Invert shader
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 Color = texture2D( gm_BaseTexture, v_vTexcoord );
gl_FragColor = vec4( vec3(1.0) - Color.rgb, Color.a);
}
Here are the next results: