Best way to mask the render area in your scene (without using a lightmask)

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

Hello everybody,

I try to render the “play area” of my game in an irregular shape on the screen. For example a tv (red area on following image (excuse my bad quick drawing skills)):

I already achieved this with a lightmask (Light2D) but I’m not sure if this is the best way. I will have many different “render masks” in the game and I’ll need a full screen lightmask for each one using this approach. Is there any better way to achieve this result?

What game do you want to create?
from what I understand, you want to make that red area glow? is that right?

Mrpaolosarino | 2021-03-26 01:54

:bust_in_silhouette: Reply From: exuin

I don’t see anything wrong with using a Light2D mask for this, but you could always do it with a shader like this example.