Red Screen Filter
This is one way to apply a filter to make the whole screen red. After rendering the scene to a texture like usual. Render a full screen quad with the following shader attached, to get the whole screen in red. This is a nice and quick effect.
By averaging the different components with the weights 0.3, 0.59, 0.11 you will get a better result than just taking equally much from each. Read more on this page about it
http://en.wikipedia.org/wiki/Grayscale
The fragment shader:
uniform sampler2D screenRT; varying vec2 uv; void main( void ) { // make the screen red, (but works fine for other channels too, of course) gl_FragColor.r = dot(texture2D( screenRT, uv ).xyz,vec3(0.3, 0.59, 0.11)); } |
3 Comments »
RSS feed for comments on this post. TrackBack URI






















Hello, you should be able to simplify to just:
uniform sampler2D screenRT;
void main( void )
{
// make the screen red, (but works fine for other channels too, of course)
gl_FragColor.r = dot(texture2D(screenRT, gl_TexCoord[0].st).xyz,vec3(0.3, 0.59, 0.11));
}
I did for use in my project at least. I’ve noticed this in a couple of your examples.
There’s a *much* easier way to get this effect: turn on alpha blending and draw a semi-transparent red quad over the whole screen!
Okey, done!