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

neercs: fix an illegal construct in the copper shader.

File size:
733 bytes

Line  

1   GLSL.Vert  

2  

3  #version 120 

4  

5  void main() 

6  { 

7  gl_Position=gl_Vertex; 

8  gl_TexCoord[0]=gl_MultiTexCoord0; 

9  } 

10  

11   GLSL.Frag  

12  

13  #version 120 

14  

15  uniform sampler2D texture; 

16  uniform vec2 screen_size; 

17  uniform float time; 

18  uniform vec4 copper; 

19  

20  void main(void) 

21  { 

22  vec2 p=gl_TexCoord[0].xy; 

23  vec3 color=texture2D(texture,p).xyz; 

24  

25  vec3 copper=vec3(0.5); 

26  copper.x+=0.5*cos(p.y*float(screen_size.y/64)+time*2.0); 

27  copper.z+=0.5*sin(p.y*float(screen_size.y/64)+time*2.0); 

28  

29  copper*=0.75+0.375*cos(p.y*float(screen_size.y/6)time*2.0); 

30  

31  /* 

32  copper.x=float(int(copper.x*8.0)*32)/256.0; 

33  copper.y=float(int(copper.y*8.0)*32)/256.0; 

34  copper.z=float(int(copper.z*8.0)*32)/256.0; 

35  */ 

36  

37  gl_FragColor=vec4((dot(color,color)==1.0)?copper:color,1.0); 

38  } 

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