Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //uniform float scale_factor = 12;
  2. uniform float scroll_speed;
  3. uniform texture overlay;
  4. uniform float overlay_mix = 0.8;
  5. uniform float overlay_texture_width = 610;
  6.  
  7. vec4 base_texture = tex(TEXTURE, UV);
  8. //vec4 overlay_texture = tex(overlay, ((UV * scale_factor) + (vec2(-scroll_speed * scale_factor, 0) * TIME)));
  9. vec4 overlay_texture = tex(overlay, UV + (vec2(mod(scroll_speed * TIME, overlay_texture_width) * 0.00125, 0)));
  10.  
  11. if (overlay_texture.a > 0) {
  12.     overlay_texture.a *= overlay_mix;
  13.     COLOR.rgb = mix(overlay_texture.rgb, base_texture.rgb, (1.0 - overlay_texture.a));
  14. } else {
  15.     COLOR.rgb = base_texture.rgb;
  16. }
  17.  
  18. COLOR.a = base_texture.a;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement