Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #version 330 core
- out vec4 FragColor;
- in vec2 TexCoord;
- uniform sampler2D ourTexture;
- uniform sampler2D dudvMap;
- uniform float time;
- uniform float width;
- uniform float height;
- void main() {
- /*
- vec4 dudvCol = texture(dudvMap, vec2(TexCoord.x + time, -TexCoord.y + time));
- vec4 dudvCol2 = texture(dudvMap, vec2(TexCoord.x + time, -TexCoord.y));
- vec4 finalDudv = mix(dudvCol, dudvCol2, 0.5);
- vec2 distortion = vec2((finalDudv.r * 2) - 1, (finalDudv.g * 2) - 1) * 0.01;
- vec2 newTexCoord = vec2(clamp(TexCoord.x + distortion.x, 0, 1), clamp(TexCoord.y + distortion.y, 0, 1));
- vec4 texCol = texture(ourTexture, vec2(newTexCoord.x, -newTexCoord.y));
- FragColor = texCol;
- */
- vec4 texCol1 = texture(ourTexture, vec2(TexCoord.x + (0.05 * sin((time * 10) + (-TexCoord.y * 10))), -TexCoord.y));
- vec4 texCol2 = texture(ourTexture, vec2(TexCoord.x, -TexCoord.y + (0.05 * cos((time * 10) + (TexCoord.x * 10)))));
- FragColor = texCol1 * texCol2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement