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:
848 bytes

Line  

1  [vert.glsl] 

2  

3  #version 120 

4  

5  void main() 

6  { 

7  gl_Position = gl_Vertex; 

8  gl_TexCoord[0] = gl_MultiTexCoord0; 

9  } 

10  

11  [frag.glsl] 

12  

13  #version 120 

14  

15  uniform sampler2D texture; 

16  uniform vec2 screen_size; 

17  uniform float time; 

18  uniform vec2 offset; 

19  uniform float noise; 

20  uniform vec3 retrace; 

21  

22  float rand(in vec2 p,in float t,in float v) 

23  { 

24  return fract(sin(dot(p+mod(t,2.0),vec2(12.9898,78.2333)))*v); 

25  } 

26  

27  void main(void) 

28  { 

29  vec2 p = gl_FragCoord.xy/screen_size.xy; 

30  

31  float r1 = rand(p,time,43758.5453); 

32  float r2 = rand(p,time,70425.2854); 

33  vec2 o = (offsetoffset*2.0*r1)/screen_size; 

34  

35  vec3 c = texture2D(texture,p+o).xyz; // offset 

36  c *= 1.0+(noisenoise*2.0*r1); // noise 

37  c = retrace.x*0.01*mod(p.y*retrace.y+time*retrace.z,1.0); // retrace 

38  gl_FragColor = vec4(c,1.0); 

39  } 

Note: See
TracBrowser
for help on using the repository browser.