How to achieve Multiply blending with Alpha channel transparency?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By chanon
:warning: Old Version Published before Godot 3 was released.

I’m having the same problem as this guy:

How can I achieve what he wants to achieve easily in Godot?

:bust_in_silhouette: Reply From: Zylann

You can get multiply blend mode by using the mul mode down in the inspector, under the CanvasItem section. If you plan to blend a sprite with a multiply blending mode, you must replace all your transparent pixels by white pixels, so white * color will get the same color and act as transparency for that blend mode.

The reason why you would get black on alpha regions is because the colour information yields black, or non-white (even if you don’t see it).

In theory you could go with alpha if you fill the color info with white, but if you have black stuff it won’t work. I suspect alpha channel is just ignored in the mul blending mode, so if you want to use a shader, what you can do is lerping towards white the further transparent the sprite is.