0 votes

I need to make a shader such that nothing is visible unless a Light2D is close, if there is no light nearby then it should be displayed as solid black. How can I do this? I've been trying to write a shader to do this but can't figure out how to.

Any help is appreciated.

asked Aug 10 in Engine by PugMasterPug (100 points)

1 Answer

+1 vote

You could use lights as a mask to achieve that. See the 2D Light Masks Demo.

answered Aug 11 by Calinou (2,428 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.