2D dynamic shadows for the Unity engine
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
2DLighting
.gitignore
2DShadows.unitypackage
LICENSE
README.md
contributors.txt

README.md

Unity 2D Shadows

About

This is an open-source Unity addon that allows you to easily create fully dynamic 2D lighting and shadows. The shadows are completely shader based and should work on Windows, OSX and WebGL (though with limitations to quality) builds. All code is commented and examples are available in the package, as well as a .unitypackage and a custom Editor within unity to set up the shadows to your liking.

It builds off of the techniques in this post and is basically a slightly expanded Unity version of it.

image

Shadows are pixel-perfect, meaning an image with transparency (for example the three dots in the image above) will generate appropriate shadow geometry. There's also the posibility to select filtering modes for the texturemaps created for the shadows, as well as blending mode for how the shadows will be applied to the objects to be lit.

editor

The editor included is meant to make it easier to edit many objects' lightsettings at once. It also provides an easy-to-find settings window for the shadow controller, so you won't have to go hunting for what object you attached that script to.

How to use

Check the Wiki page here on GitHub for a quick-setup guide.

Notice

This project is under the Apache 2.0 license. Feel free to clone and extend, or contribute to this project! Any improvements or suggestions are much apprechiated, as this was made to be free and open to everyone using Unity.