Advertisement
Tkap1

Untitled

Sep 17th, 2024
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. @include "shaders/common.glsl"
  3.  
  4. in vec4 v_color;
  5. in vec2 v_local_uv;
  6. in vec3 v_frag_pos;
  7. in vec4 v_frag_pos_light_space;
  8. in flat vec2 v_size;
  9.  
  10. out vec4 f_color;
  11.  
  12. uniform float time;
  13.  
  14. layout (binding = 1) uniform sampler2D in_noise;
  15.  
  16.  
  17. void main()
  18. {
  19.     vec2 uv = v_local_uv;
  20.     float n = texture(in_noise, v_local_uv).r;
  21.     n = pow(n, 2.0);
  22.     uv = uv * 2.0 - 1.0;
  23.     vec2 uv2 = abs(uv);
  24.     vec3 color0 = vec3(0.111765, 0.315686, 0.601961) * 0.25;
  25.     vec3 color1 = vec3(0.32, 0.32, 0.69) * 0.25;
  26.     float y_offset = (step(0.5, v_local_uv.y) + 1.0) * 12.4;
  27.     float s2 = sin(uv.x * 10.0 + time + y_offset) * 0.1;
  28.     float s3 = sin(uv.x * 33.0 + time + y_offset) * 0.05;
  29.     float s4 = sin(uv.x * 51.2 + time + y_offset) * 0.025;
  30.     uv2.y += s2 + s3 + s4;
  31.     uv2.y += n * 1.0;
  32.     float s = smoothstep(0.5, 1.0, uv2.y);
  33.  
  34.     float alpha_multi = sin_range(time * 20, 0.7, 1.0);
  35.  
  36.     f_color = mix(vec4(color1, 0.0), vec4(color0, alpha_multi), s);
  37.     f_color = pma(f_color);
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement