godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.15k stars 97 forks source link

Add Shadows Only render mode to Light2D #4807

Open Raiguri opened 2 years ago

Raiguri commented 2 years ago

Describe the project you are working on

Im creating a game, which have 2Dlights for "lighting". And I also have another 2dlight for FOV which contains in a canvas layer, on this canvas layer there is white background, light and walls.

Describe the problem or limitation you are having in your project

image I want to hide white background and show only SHADOWS

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Make Shadows Only feature it would just be the opposite of the Lights Only feature

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

We will see only shadows, but the object itself will dissapear

If this enhancement will not be used often, can it be worked around with a few lines of script?

No.

Is there a reason why this should be core and not an add-on in the asset library?

Because it's simple feature that will make Godot Engine even more user-friendly

Calinou commented 2 years ago

Lighting in Godot is additive. If there is no light, then there is no visible shadow to begin with. The same caveat applies to 3D rendering.

Raiguri commented 2 years ago

Lighting in Godot is additive. If there is no light, then there is no visible shadow to begin with. The same caveat applies to 3D rendering.

So it's not possible to hide White bg, and show only shadows that are on this bg?

Calinou commented 2 years ago

So it's not possible to hide White bg, and show only shadows that on this bg?

This may be achievable using a Viewport and a custom post-processing shader.

Raiguri commented 2 years ago

So it's not possible to hide White bg, and show only shadows that on this bg?

This may be achievable using a Viewport and a custom post-processing shader.

Sad that this thing can't be implemented like a user-friendly feature. Thanks for the tip, I will try to learn more about Viewport and Shaders

Raiguri commented 2 years ago

So it's not possible to hide White bg, and show only shadows that on this bg?

This may be achievable using a Viewport and a custom post-processing shader.

image I tried to make viewport and use special shader that works like ChromaKey, but when I use it, white bg and shadow dissapears..

Raiguri commented 2 years ago

So it's not possible to hide White bg, and show only shadows that on this bg?

This may be achievable using a Viewport and a custom post-processing shader.

Problem solved. I just used EasyBlend Burn. But it would be much greater if "shadows only" was a feature.