My first two developer’s diaries described how Wolfire set up it’s optimized terrain mesh, blended the seam between the skybox and the terrain with a special haze effect and created self-shadowing terrain given the sun’s position. This is all well and good for a realistic-looking barren wasteland but what happens when you add objects to the mix? A few extra lighting and shading cases get created.
One major case is that objects on the terrain should be casting shadows on the terrain. In the world of Overgrowth where there are no high-tech explosives, it seems reasonable that a big rock like this one, is not going to get moved around.
Therefore, this object can be treated as static geometry just like the terrain itself. The same algorithm that gets used to bake the terrain’s self shadowing effects onto the terrain texture, can also be used to bake static object shadows onto the texture. Here is the result of David’s object shadowing work.
In addition to objects casting shadows on the terrain, the terrain should also cast shadows on objects. Obviously, objects shielded from the sun by the peak of a sand dune should be darker than objects receiving direct sunlight. Here’s what it should look like.

This is a great start for direct lighting with static objects. Dynamic objects become a bit trickier because if you try to update shadows in real time, it can be very expensive. Also, in the real world, a good part of the lighting that appears on an object is not caused by direct sunlight but rather indirect ambient lighting emitted from the whole sky. Wolfire’s Phoenix Engine accounts for these issues but I will save them for a future post.
To catch the latest Wolfire development news, please check out the Wolfire Blog.