Skip to content

An example of how to drawing Terraria style block lighting and shadows.

Notifications You must be signed in to change notification settings

BigDaddyGameDev/Tile-Light-and-Shadows-Like-Terraria

Repository files navigation

Tile Light and Shadows Like Terraria

An example of how to draw Terraria style block lighting and shadows for Unity.

Example

#More Useful 2D Sandbox Platformer Assets

  1. Tilemap Platformer Water
  2. A Star Platformer Pathfinding

#How does it work?

  1. There's 2 cameras.
  2. Empty tiles are filled in with white blocks (only camera 2 render this)
  3. A gaussian blur is applied to the camera rendering the white blocks
  4. SpriteLightKit blends the two cameras, darkening everything not covered by the white blurry.
  5. You can adjust the "light" penetration by changing the white tile's sprite's Pixels Per Unit.

#Credit:

prime31's SpriteLightKit

keijiro's GaussianBlur

#To Do:

  • Add light sources (e.g. torches)
  • Day / night Cycle

About

An example of how to drawing Terraria style block lighting and shadows.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published