Godot Version
4.6
Question
Hi! my question is more a “sanity check” of something i wrote more than a full question. Basically i have this problem i have a panel node with several children. One of them is a TextureRect set to blend mode = multiply. I have a fading animation on the panel that transitions the panel alpha to zero (or to 1). Everything works fine except for the texture… the texture stays fully visible until alpha is 2/255 after it is completely transparent…
I guess it is because in blend_mode multiply alpha is ignore? The solution i found out to “solve” this behaviour is using this simple shader that basically “mix” the texture with white since white is the “do nothing color” for blend mode multiply:
shader_type canvas_item;
render_mode blend_mul;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
vec4 tex_color = texture(TEXTURE, UV);
float effective_alpha = tex_color.a * COLOR.a;
COLOR.rgb = mix(vec3(1.0), tex_color.rgb, effective_alpha);
}
it works but i am unsure, is this the right approach or maybe i am missing some default feature or method in godot? Sorry if this is a trivial question