From 94c83eb5ef9814f8a493908bf217d121d217efee Mon Sep 17 00:00:00 2001 From: rez Date: Wed, 3 Oct 2012 23:41:47 +0000 Subject: [PATCH] NEERCS: added missing remanence.lolfx --- neercs/video/remanence.lolfx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 neercs/video/remanence.lolfx diff --git a/neercs/video/remanence.lolfx b/neercs/video/remanence.lolfx new file mode 100644 index 0000000..dc9fb7a --- /dev/null +++ b/neercs/video/remanence.lolfx @@ -0,0 +1,30 @@ +[vert.glsl] + +#version 120 + +void main() +{ + gl_Position = gl_Vertex; + gl_TexCoord[0] = gl_MultiTexCoord0; +} + +[frag.glsl] + +#version 120 + +uniform sampler2D source; +uniform sampler2D buffer; +uniform vec2 mix; + +void main(void) +{ + vec4 old_color = texture2D(buffer, gl_TexCoord[0].xy); + vec4 new_color = texture2D(source, gl_TexCoord[0].xy); + + /* The old way */ + //gl_FragColor = new_color * mix.x + old_color * mix.y; + + /* The new way: if new_color > old_color we want faster updates */ + gl_FragColor = max(new_color, new_color * mix.x + old_color * mix.y); +} +