source: trunk/tools/neercs/video/copper.lolfx @ 2160

Last change on this file since 2160 was 2160, checked in by sam, 8 years ago

neercs: disable the copperbars because they're not very nice, lol.

File size: 1.0 KB
Line 
1[vert.glsl]
2
3#version 120
4
5varying vec2 pass_TexCoord;
6
7void main()
8{
9    gl_Position = gl_Vertex;
10    pass_TexCoord = vec2(0.5, 0.5) + 0.5 * gl_Vertex.xy;
11}
12
13[frag.glsl]
14
15#version 120
16
17varying vec2 pass_TexCoord;
18
19uniform sampler2D texture;
20uniform vec2 screen_size;
21uniform float time;
22uniform vec4 copper;
23uniform vec3 mask_color;
24
25void main(void)
26{
27    vec2 p = pass_TexCoord;
28    vec3 source = texture2D(texture, p).xyz;
29
30    vec3 color = vec3(0.5);
31
32    color.x += 0.5 * cos(p.y*float(screen_size.y / copper.w) + time);
33    color.z += 0.5 * sin(p.y*float(screen_size.y / copper.w) + time);
34
35    color *= copper.x + copper.y * cos(p.y * float(screen_size.x / copper.z));// - time);
36
37    color.x = float(int(color.x * 8.0) * 32) / 256.0;
38    color.y = float(int(color.y * 8.0) * 32) / 256.0;
39    color.z = float(int(color.z * 8.0) * 32) / 256.0;
40
41    // XXX: copper disabled because it's not very nice, lol
42    //gl_FragColor = vec4((source == mask_color) ? color : source, 1.0);
43    gl_FragColor = vec4(source, 1.0);
44}
Note: See TracBrowser for help on using the repository browser.