Jump to content

May 2017 »

28 29 3031   
- - - - -

Screenshot Saturday 170

4: Adsense

Hello and welcome to another week of Lemma development progress updates!

This time I did a lot more work on the player character. I spent a ton of time in GIMP working on the texture map. I didn’t skimp on memory space, it’s a full 4096×4096. The GIMP file is over 150MB.

I also split the model into three distinct materials: a shiny one for the chest, neck, and pants, a less shiny one for the hands, and a completely dull one for the hoodie. I stored the mappings for these materials in the texture’s alpha channel.

Finally I cut the triangle count from almost 60,000 down to about 26,000 without noticeably decreasing the visual quality. I did this by removing an extraneous subsurf layer from the hands and baking the high-res data into the normal map. Here’s the final result:
Posted Image

(Ignore the shadow hole near the shoes… it’s a geometry issue)
I also did a ton of work on the animation system. I was using linear matrix interpolation, which can result in a lot of weird squashing when blending between animations:
Posted Image

Now I decompose each bone matrix into its scale, rotation, and translation components and blend them individually. The result is much more natural:
Posted Image

I also now use quadratic easing to blend between animations. Before, the model would move to the target pose at a constant speed and then instantly stop, like this:
Posted Image

Now the model accelerates and decelerates much more naturally:
Posted Image

Finally, I implemented a nifty technique to improve the shadows even more. Normally you bias your shadow map samples by a constant amount, or perhaps you scale it by the “depth slope”, so that more problematic triangles facing perpendicular to the camera get more bias.

Shadow map bias is a necessary evil because it causes Peter Pan artifacts, where the shadow becomes detached from the shadow caster:
Posted Image

I was researching all this when I stumbled on normal offset shadows. It’s simple: offset your shadow map sample in the direction of the normal. It works beautifully:
Posted Image

It also has the added benefit of simulating a bit of depth in your texture if you use a normal map.
That’s it for this week. Thanks for reading!
Mirrored on my blog

May 11 2014 02:08 PM

New model looking great.


Thanks for the link on normal offset shadows, looks like a very useful technique.

May 13 2014 05:12 PM

I like the lighting. Add more of it and you can have a very good-looking game.

Note: GameDev.net moderates comments.