Advertisement
gmfreaky

Untitled

Aug 11th, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. /* Shaders:
  2.  
  3. fragmentation shader:
  4. #version 330 core
  5.  
  6. in vec2 UV;
  7.  
  8. out vec3 color;
  9.  
  10. uniform sampler2D renderedTexture;
  11. uniform float time;
  12.  
  13. void main(){
  14.     color = texture( renderedTexture, UV + 0.05*vec2( sin(time+1024.0*UV.x),cos(time+768.0*UV.y)) ).xyz;
  15. }
  16.  
  17. vertex shader:
  18. #version 330 core
  19.  
  20. // Input vertex data, different for all executions of this shader.
  21. layout(location = 0) in vec3 vertexPosition_modelspace;
  22.  
  23. // Output data ; will be interpolated for each fragment.
  24. out vec2 UV;
  25.  
  26. void main(){
  27.     gl_Position =  vec4(vertexPosition_modelspace,1);
  28.     UV = (vertexPosition_modelspace.xy+vec2(1,1))/2.0;
  29. }
  30. */
  31.  
  32. // Initalize shaders
  33. texID =     ARBShaderObjects.glGetUniformLocationARB(Shaders.post_pass.id, "renderedTexture");
  34. timerID =   ARBShaderObjects.glGetUniformLocationARB(Shaders.post_pass.id, "time");
  35.        
  36.         System.out.println("texid location = "+texID);
  37.         System.out.println("timerid location = "+texID);
  38.  
  39.  
  40. /* Output:
  41.  
  42. texid location = 0
  43. timerid location = 0
  44. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement