An example of how to draw Terraria style block lighting and shadows for Unity.
#More Useful 2D Sandbox Platformer Assets
#How does it work?
- There's 2 cameras.
- Empty tiles are filled in with white blocks (only camera 2 render this)
- A gaussian blur is applied to the camera rendering the white blocks
- SpriteLightKit blends the two cameras, darkening everything not covered by the white blurry.
- You can adjust the "light" penetration by changing the white tile's sprite's Pixels Per Unit.
#Credit:
#To Do:
- Add light sources (e.g. torches)
- Day / night Cycle