Animation Step 4 – Sprite Lights with Sprite Dlite

There’s one final feature we really wanted to include in this game, and that’s to add lighting effects to 2D sprites.

The problem is that lighting in Unity (which is 3D) doesn’t ordinarily work that well with flat two dimensional objects. A flat surface is either lit or unlit – it’s difficult to create a sense of texture.

Of course there are tools that will do this for you. One we were keen to try out was Sprite Dlite.

Got it up and running today, and just done the first rudimentary tests, looks like it’s working as advertised!

I had a minor problem after download thanks (again) to Apple’s permissions, the Sprite DLight guy (Dennis) told us how to fix it.

So basically all we did was grab one of the old PNGs from one of the old walk cycles and dropped it in there, from there you can easily adjust the settings. We’ll have to spend a bit of time figuring out what combination of settings give the best results, but it shouldn’t be too hard.

From there, this video shows how to plug it in to Unity, it’s preeettty basic.

One of the main problems so far is that the shadows aren’t all that realistic in some places, but maybe there are ways to fix that.Screen Shot 2015-08-23 at 2.19.12 pm Screen Shot 2015-08-23 at 2.19.36 pm

The output is this ‘normal’ map – the garish bright colours on the right – and the result is on the left. The normals tell Unity how to throw the shadows and light.
Web Coder – makers of Texture Packer – also have Spite Illuminator, which does the same thing as Sprite Dlite. We’ll keep you posted on which one we end up with, but basically we’re pretty dang happy! Now we can establish a solid workflow – with a bunch of 3rd party software – to really move into the production phase of this build.

Leave a comment