Using normal maps to create lighting for 2D sprites.

Ahoy, space-huntsman! So in the past I was having trouble trying to create lighting for my sprites in my game. I was trying to find a way to pull this off that didn’t require a massive amount of work and looked a good quality.

I actually tried to use a few unity made plugins as well as sprite lamp but nothing was coming out the way I wanted it too. This is when I accidentally ran across something really powerful that does more then just add lighting to your sprites, it makes your sprites look nearly three-dimensional.

First off, here is what the finished product actually looks like.

StructureGif

Long story short you can create normal maps from sprites using Illustrator or Photoshop pretty easily by layering your sprites as you develop them.  You then apply those normal maps onto your sprites normal map layer. In order to do this you’ll need to make sure you have a custom sprite shader that takes in both a sprite and a normal map.

Here is a link for a sprite shader with a normal in case you need one. Here

Here is the normal map.

NormalMapSprite2

 

Here is the sprite without a normal map attached. (see how flat it looks in comparison)

SpriteNonNormalMap

Here is a screenshot of it in game.

NormalMapSprite

Not only do your sprites receive lighting but they also appear to have 3d geometry as a consequence. I’ve actually been told several times now during play-testing that the structures in our game we’re 3d models. Little do they know :P

Anyways I hope this may be as helpful for you as it was for me!

Be sure to subscribe on our website for news, updates and free demos. here

Also be sure to check out our facebook and twitter.

4 comments to “Using normal maps to create lighting for 2D sprites.”

You can leave a reply or Trackback this post.
  1. how did you make the normal map? is there an easy way to do it on Photoshop?

  2. blackseaodyssey says: -#1

    Jacob, because we have a geometric art style and create our art using vector graphics (instead of bitmap), it is easy to keep separate layers which we then color according to the normal map colors. This works for Blacksea Odyssey’s art style because it’s geometric and made with vectors. If you make pixel art or painterly art, you’d want to look into one of these two software.
    http://www.2deegameart.com/p/sprite-dlight.html
    http://www.snakehillgames.com/spritelamp/

  3. That is amazingly cool.

  4. blackseaodyssey says: -#1

    Thanks! It really ads a whole new layer of aesthetic awesomeness. Glad you like it! :)

Leave a Reply to Jacob holland Cancel reply

Your email address will not be published.

Facebook IconYouTube IconTwitter IconVisit Our IndieDB