Advertisement
PaleoCrafter

Untitled

Jul 30th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #version 120
  2.  
  3. uniform sampler2D tex;
  4. uniform sampler2D noiseTex;
  5. uniform float windowWidth;
  6. uniform float windowHeight;
  7. uniform float ticks;
  8. uniform float strength;
  9.  
  10. // Shader entry point
  11. void main()
  12. {
  13.     vec4 pos = gl_FragCoord;
  14.     vec2 uv = pos.xy / vec2(windowWidth, windowHeight);
  15.     vec4 noisePixel1 = texture2D(noiseTex, gl_TexCoord[0].st * 4.0 + vec2(ticks * 0.324823048, ticks * 0.48913801));
  16.     vec4 noisePixel2 = texture2D(noiseTex, gl_TexCoord[0].ts * 4.0 + vec2(ticks * 0.52890348, ticks * 0.6318212));
  17.     vec4 joinedNoise = noisePixel1 + noisePixel2 - 1.0;
  18.     float depthMul = min(0.4 / sqrt(sqrt(sqrt(1.0 - pos.z))) - 0.4, 1.0);
  19.     vec4 newColor = texture2D(tex, clamp(uv.st + joinedNoise.rg * strength * depthMul, 0.0, 1.0));
  20.  
  21.     gl_FragColor = newColor;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement