Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shader_type canvas_item;
- uniform sampler2D anim_texture;
- uniform float bpm = 95.0;
- uniform vec4 component_multiply : hint_color;
- uniform float b_mult = 0.5;
- uniform vec4 color_r : hint_color;
- uniform vec4 color_g : hint_color;
- uniform vec4 color_b : hint_color;
- void fragment(){
- float a = texture(TEXTURE, UV).a;
- float r = texture(TEXTURE, UV).r;
- float g = texture(TEXTURE, UV).g;
- float b = texture(TEXTURE, UV).b;
- b *= b_mult;
- float time_phase = mod(TIME * bpm / 60.0, 1.0);
- float r_value = texture(anim_texture, vec2(time_phase, r)).r;
- float g_value = texture(anim_texture, vec2(time_phase, g)).g;
- float b_value = texture(anim_texture, vec2(time_phase, b)).b;
- r_value *= component_multiply.r;
- g_value *= component_multiply.g;
- b_value *= component_multiply.b;
- // COLOR.rgb = max(g_value, max(r_value, b_value)) * vec3(1.0);
- vec4 color = vec4(0.0);
- color = mix(color, color_b, b_value);
- color = mix(color, color_r, r_value);
- color = mix(color, color_g, g_value);
- COLOR.rgb = color.rgb;
- COLOR.a = min(max(max(r_value, b_value), g_value), a);
- }
Advertisement
Add Comment
Please, Sign In to add comment