[color=rgb(85,85,85)][font=Arial]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 4096x4096. The GIMP file is over 150MB.[/font][/color]
[color=rgb(85,85,85)][font=Arial]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.[/font][/color]
[color=rgb(85,85,85)][font=Arial]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:[/font][/color]
[color=rgb(85,85,85)][font=Arial][/font][/color]
[color=rgb(85,85,85)][font=Arial](Ignore the shadow hole near the shoes... it's a geometry issue)[/font][/color]
[color=rgb(85,85,85)][font=Arial]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:[/font][/color]
[color=rgb(85,85,85)][font=Arial][/font][/color]
[color=rgb(85,85,85)][font=Arial]Now I decompose each bone matrix into its scale, rotation, and translation components and blend them individually. The result is much more natural:[/font][/color]
[color=rgb(85,85,85)][font=Arial][/font][/color]
[color=rgb(85,85,85)][font=Arial]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:[/font][/color]
[color=rgb(85,85,85)][font=Arial][/font][/color]
[color=rgb(85,85,85)][font=Arial]Now the model accelerates and decelerates much more naturally:[/font][/color]
[color=rgb(85,85,85)][font=Arial][/font][/color]
[color=rgb(85,85,85)][font=Arial]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.[/font][/color]
[color=rgb(85,85,85)][font=Arial]Shadow map bias is a necessary evil because it causes Peter Pan artifacts, where the shadow becomes detached from the shadow caster:[/font][/color]
[color=rgb(85,85,85)][font=Arial][/font][/color]
[color=rgb(85,85,85)][font=Arial]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:[/font][/color]
[color=rgb(85,85,85)][font=Arial][/font][/color]
[color=rgb(85,85,85)][font=Arial]It also has the added benefit of simulating a bit of depth in your texture if you use a normal map.[/font][/color]
[color=rgb(85,85,85)][font=Arial]That's it for this week. Thanks for reading![/font][/color]
[color=rgb(85,85,85)][font=Arial]Mirrored on my blog[/font][/color]
New model looking great.
Thanks for the link on normal offset shadows, looks like a very useful technique.