Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #version 120
- uniform sampler2D tex;
- uniform sampler2D noiseTex;
- uniform float windowWidth;
- uniform float windowHeight;
- uniform float ticks;
- uniform float strength;
- // Shader entry point
- void main()
- {
- vec4 pos = gl_FragCoord;
- vec2 uv = pos.xy / vec2(windowWidth, windowHeight);
- vec4 noisePixel1 = texture2D(noiseTex, gl_TexCoord[0].st * 4.0 + vec2(ticks * 0.324823048, ticks * 0.48913801));
- vec4 noisePixel2 = texture2D(noiseTex, gl_TexCoord[0].ts * 4.0 + vec2(ticks * 0.52890348, ticks * 0.6318212));
- vec4 joinedNoise = noisePixel1 + noisePixel2 - 1.0;
- float depthMul = min(0.4 / sqrt(sqrt(sqrt(1.0 - pos.z))) - 0.4, 1.0);
- vec4 newColor = texture2D(tex, clamp(uv.st + joinedNoise.rg * strength * depthMul, 0.0, 1.0));
- gl_FragColor = newColor;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement