Lipoc-ship

3D to 2D… Have we Gone Mad?

So, today I asked our new artist to help make some ship concepts as we are struggling with modeling cool ships. To date our game has always used a mix of 2d/3d, but 3d for ships/planets/surfaces and 2d for fx, aliens, ui, etc.

In about an hour he color sketched the following for the lipoc race:
[img]http://media.indiedb.com/cache/images/games/1/28/27385/thumb_620x2000/Lipoc.jpg[/img]

Looked pretty good and made me rethink using 3d ships. If we could make 2d look good enough, it really would save a ton of modeling time, so I asked him to make a ship overhead view for the Veelow race. About an hour later I had this:
[img]http://media.indiedb.com/cache/images/games/1/28/27385/thumb_620x2000/VeeLow-black.png[/img]

hmmm… cool concept, so I put it in the game as a 2d sprite. As I feared I couldn’t get any form of lighting on a 2d quad to look anything but terrible. The lighting for the 3d models was great… can’t backtrack to have virtually no lighting for 2d sprites, and for SURE don’t want to go back to the stone ages of making a ton of sprites w manually painted lighting at various angles.

I remembered an awesome kickstart a while back for lamplight. For those unfamiliar, this is REALLY worth a look:
[url=https://www.kickstarter.com/projects/finnmorgan/sprite-lamp-dynamic-lighting-for-2d-art]https://www.kickstarter.com/projects/finnmorgan/sprite-lamp-dynamic-lighting-for-2d-art[/url]

So I looked into doing something similar in Unity. The Unity community being huge and awesome, low and behold someone already beat me to it (Huge kudos to Kencho):
[url=http://kencho-dev-blog.blogspot.com.es/2014/01/cel-shaded-sprites-in-unity3d-43-and.html]http://kencho-dev-blog.blogspot.com.es/2014/01/cel-shaded-sprites-in-unity3d-43-and.html[/url]

So I started implementing a custom shader based on Kencho’s work. I struggled a bit at first but I’m thrilled with the end result… 2d realtime lighting that really looks great/3dish. Note the image below is 3 screenshots merged w the same ship at multiple angles so you can see 1:1 pixel of the lighting:
[img]http://media.indiedb.com/cache/images/games/1/28/27385/thumb_620x2000/lighting-merged.jpg[/img]

The basics is a custom shader to use a normal map, which is generated from a horiz lighting and vert lighting. Here are my two lighting images:
[img]http://media.indiedb.com/cache/images/games/1/28/27385/thumb_620x2000/VeeLow-Top2.1.png[/img]
[img]http://media.indiedb.com/cache/images/games/1/28/27385/thumb_620x2000/VeeLow-Left2.1.png[/img]

And of course I need a gif to really show the effect:
[img]http://i.minus.com/ibzpt6UsoRc8BT.gif[/img]

I still need to balance out the left/top lighting images and tweak the base image to not have lighting from the front baked in, but I’m pretty happy with the results.

0 Comments

Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>