source: trunk/tools/neercs/video/remanence.lolfx @ 1973

Last change on this file since 1973 was 1973, checked in by rez, 8 years ago

NEERCS: added missing remanence.lolfx

File size: 579 bytes
Line 
1[vert.glsl]
2
3#version 120
4
5void main()
6{
7    gl_Position = gl_Vertex;
8    gl_TexCoord[0] = gl_MultiTexCoord0;
9}
10
11[frag.glsl]
12
13#version 120
14
15uniform sampler2D source;
16uniform sampler2D buffer;
17uniform vec2 mix;
18
19void main(void)
20{
21    vec4 old_color = texture2D(buffer, gl_TexCoord[0].xy);
22    vec4 new_color = texture2D(source, gl_TexCoord[0].xy);
23
24    /* The old way */
25    //gl_FragColor = new_color * mix.x + old_color * mix.y;
26
27    /* The new way: if new_color > old_color we want faster updates */
28    gl_FragColor = max(new_color, new_color * mix.x + old_color * mix.y);
29}
30
Note: See TracBrowser for help on using the repository browser.