Quantcast
Channel: Game Rendering » Special Effects
Viewing all articles
Browse latest Browse all 4

Red Screen Filter

$
0
0

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.

 The original output to the left, the result of the filter to the right

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

Viewing all articles
Browse latest Browse all 4

Trending Articles