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

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

NEERCS: fixed setup value bar length / fixed copper setup

File size: 852 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 texture;
16uniform vec2 screen_size;
17uniform float time;
18uniform vec4 copper;
19uniform vec3 mask_color;
20
21void main(void)
22{
23    vec2 p = gl_TexCoord[0].xy;
24    vec3 source = texture2D(texture, p).xyz;
25
26    vec3 color = vec3(0.5);
27
28    color.x += 0.5 * cos(p.y*float(screen_size.y / copper.w) + time);
29    color.z += 0.5 * sin(p.y*float(screen_size.y / copper.w) + time);
30
31    color *= copper.x + copper.y * cos(p.y * float(screen_size.x / copper.z));// - time);
32
33    color.x = float(int(color.x * 8.0) * 32) / 256.0;
34    color.y = float(int(color.y * 8.0) * 32) / 256.0;
35    color.z = float(int(color.z * 8.0) * 32) / 256.0;
36
37    gl_FragColor = vec4((source == mask_color) ? color : source, 1.0);
38}
Note: See TracBrowser for help on using the repository browser.