Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Shaders:
- fragmentation shader:
- #version 330 core
- in vec2 UV;
- out vec3 color;
- uniform sampler2D renderedTexture;
- uniform float time;
- void main(){
- color = texture( renderedTexture, UV + 0.05*vec2( sin(time+1024.0*UV.x),cos(time+768.0*UV.y)) ).xyz;
- }
- vertex shader:
- #version 330 core
- // Input vertex data, different for all executions of this shader.
- layout(location = 0) in vec3 vertexPosition_modelspace;
- // Output data ; will be interpolated for each fragment.
- out vec2 UV;
- void main(){
- gl_Position = vec4(vertexPosition_modelspace,1);
- UV = (vertexPosition_modelspace.xy+vec2(1,1))/2.0;
- }
- */
- // Initalize shaders
- texID = ARBShaderObjects.glGetUniformLocationARB(Shaders.post_pass.id, "renderedTexture");
- timerID = ARBShaderObjects.glGetUniformLocationARB(Shaders.post_pass.id, "time");
- System.out.println("texid location = "+texID);
- System.out.println("timerid location = "+texID);
- /* Output:
- texid location = 0
- timerid location = 0
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement