Welcome to the Wolfire Blog! This is where we keep everyone up to date on our progress on Overgrowth and other new stuff. Be sure to subscribe to get the latest news! Also, be sure to check out the forums for even more up to date news - or get on IRC for up to the second updates.

Character shadows

Add Comment! By David Rosen on November 13th, 2009

The existing Overgrowth shadows worked well for static shadows and ambient occlusion, but didn't have the detail required for character shadows. To achieve high-quality character shadows, we needed a new hybrid system. Here's a picture of the new shadows in action!

Character shadow

Some might complain that this is a waste of time at this point, but I need shadows in order to test out the physics appropriately. Without detailed shadows, it's difficult to tell whether or not objects are in contact with the ground. With shadows, it's much easier. Here's an example -- if you look closely, you might be able to tell if this physics object is touching the ground or not.

Character shadow

I say this is a hybrid system because it works using decals. I've already explained how the decal projection works, so now we just have to make the decal look like a shadow! To do that, we first take a picture of the character from the perspective of the light, and project it onto the ground.

Character shadow

Next, we remove the white so that only the shadow is visible. Despite its simplicity, it is already looking pretty shadow-like.

Character shadow

However, it's still too dark to match the baked shadows, so we have to make it more transparent. The shadow's transparency should equal the brightness of the ambient light.

Character shadow

There's still one small problem -- some areas are getting shadowed twice! To fix this, we can subtract the baked shadows from the decal shadows. Here's the finished composite:

Character shadow

This has the side effect of fixing a common problem with this kind of system -- shadows going through walls. Surfaces on the other side of the wall are always in shadow, so the second projected shadow is removed.

Character shadow

I thought that combining character shadows with our baked lighting would be very complicated, but it actually turned out to be fairly straightforward. We sure dodged a bullet with that one!

Character shadow
Or is he dodging that forced pun?

There are still some tricky shadow problems left to solve, including casting baked shadows onto characters, and handling multiple dynamic shadows overlapping. However, nobody seemed to notice that they were never solved in big titles like Halo 3 and Gears of War 2, so I think we can save them for later! For now, I can just use them to test out the physics and animation contacts.

These pictures were all taken on Hale's Riverhurst level because it provided a lot of complex spaces to test out different shadow situations. If you guys could make more levels, it would help us test out new features and optimize the engine!