How to blend transparent shapes?

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

On the left are 2 Sprite shadows with alpha of 0.5

I thought I could work around this by using draw_rect but no :<
draw_ functions also work like this

:bust_in_silhouette: Reply From: GameSpy

Put both boxes on a separate scene
Put the scene in a Viewport node
Set the Transparent Bg on on the Viewport
Put the Viewport in a ViewportContainer
Set the Viewport container’s modulate property to 0.5

dee end

Interesting! I wonder how I could do this for hundreds of objects.

Dlean Jeans | 2020-08-10 14:31

You would put the objects in the scene. Dah. You can put all these objects below the Viewport node and have them interact with your main scene. The Viewport will output one texture that you can then set to transparent (don’t forget the ViewportContainer).
The best solution would be for the Engine to have a node with the modulate property that automatically composes one texture of its children. Sadly, a node that merges its children like that is only available in the “Alabama” version of the engine.

GameSpy | 2020-08-10 16:05