How to achieve Multiply blending with Alpha channel transparency in Godot 3.0?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By chanon


I asked this once for Godot 2.1

Now in Godot 3.0 there is no more blend mode option under CanvasItem.

How can I achieve a multiply blending mode with alpha channel in Godot 3.0?

edit: I tried adding a material with a shader using just this as the shader source:

shader_type canvas_item;
render_mode blend_mul;

It seems to work … is this the correct way to do it?

:bust_in_silhouette: Reply From: Calinou

You can create a new CanvasItemMaterial resource as the Material property of any node inheriting from CanvasItem (such as Sprite and Control). In that resource, you can set a blend mode such as mix (the default), addition, substraction, multiplication and pre-multiplied alpha.