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

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

NEERCS: added copper in setup (not working yet)

File size: 780 bytes
Line 
1-- GLSL.Vert --
2
3#version 120
4
5void main()
6    {
7    gl_Position=gl_Vertex;
8    gl_TexCoord[0]=gl_MultiTexCoord0;
9    }
10
11-- GLSL.Frag --
12
13#version 120
14
15uniform sampler2D texture;
16uniform vec2 screen_size;
17uniform float time;
18uniform vec4 copper;
19
20void main(void)
21    {
22    vec2 p=gl_TexCoord[0].xy;
23    vec3 source=texture2D(texture,p).xyz;
24
25    vec3 color=vec3(0.5);
26
27    color.x+=0.5*cos(p.y*float(screen_size.y/copper.z)+time*2.0);
28    color.z+=0.5*sin(p.y*float(screen_size.y/copper.z)+time*2.0);
29
30    color*=copper.x+copper.y*cos(p.y*float(screen_size.x/copper.w)-time*2.0);
31
32    color.x=float(int(color.x*8.0)*32)/256.0;
33    color.y=float(int(color.y*8.0)*32)/256.0;
34    color.z=float(int(color.z*8.0)*32)/256.0;
35
36    gl_FragColor=vec4((color==1.0)?color:source,1.0);
37    }
Note: See TracBrowser for help on using the repository browser.