Files
pomchronicles/shaders/nonvariant_sprite.gdshader
2025-10-09 14:52:47 -04:00

26 lines
460 B
Plaintext

shader_type canvas_item;
render_mode blend_mix;
uniform bool flash;
uniform float flash_strength = 0.4;
uniform vec4 highlight : source_color = vec4(1,1,1,0);
void vertex() {
}
void fragment() {
vec4 col = texture(TEXTURE, UV);
vec4 h = highlight;
if(flash){
h.a = flash_strength * (sin(TIME * 10.0) + 1.0)/2.0;
}
//COLOR.r *= col.r;
//COLOR.g *= col.g;
//COLOR.b *= col.b;
COLOR.rgb = mix(COLOR.rgb, h.rgb, h.a);
COLOR.a = col.a * COLOR.a;
}