Summary
The key to this effect is an interaction between the shadow light object and the source-in blend mode.
We create an image representing darkness and place it above the shadow light object (z-order). These two objects are isolated to their own transparent layer with force own texture on.
Any shadows created by the shadow light object now act as the destination (background) to the source (foreground aka the darkness image).
Source-in blend mode means wherever the destination is visible the source is visible. Wherever the destination is transparent the source is transparent. Therefore wherever there were shadows there is now our image.
Example effect:
Steps to Reproduce
- Create a transparent layer with force own texture on. This layer should go above everything except your UI.
- On that layer create an image representing darkness/shadow. In the example above darkness is a schematic of the current level.
- On the same layer create a shadow light and place it under your darkness image (in terms of z order).
- Set your darkness image's blend mode to source in.