Shedding Some Light On Overgrowth's Terrain Rendering System
In last week's developer diaries I explained how Wolfire is laying the foundation for Overgrowth by starting with the Phoenix Engine's terrain system. While I mentioned how the terrain meshes are created with our "Off The Grid" system, I left out an equally important part of the puzzle. Before you can design complex, good looking player models and level assets, you need to have some idea of how the assets will look when they are rendered in-engine. This week's developer diary will describe Wolfire's initial work on terrain coloring, lighting and shading and how terrain has combined with the sky to form one cohesive environment.

David got specular lighting, diffuse lighting and bump mapping set up right away on the terrain. These features are pretty much standard for all 3D video games. However, David decided early on that there needed to be realistic atmospheric haze. David not only employed a radial haze system that avoids distortion when the camera is moved, but he also made it procedurally dependent on the sky box. Because the haze color is sampled from the sky image behind it, even if we use sunset sky boxes with many drastically different colors, the haze will blend in nicely. In the picture above, you can see how the left side looks like terrain shoved under a picture of the sky. On the right side, David's subtle fog effects on the distant mountains really make the world feel like it has a continuous atmosphere.

Next, Aubrey started working on our terrain textures. He discovered that World Machine 2 offers a great way to add realistic terrain detail in the form of a macro texture map. Even erosion data gets calculated and affects the terrains appearance. The picture above shows Aubrey's texturing on Phillip's "Off the Grid" terrain geometry, accented by David's radial haze effect. I was shocked to see all these features appied together because at such an early stage, our terrain was already approaching photo realism. However, something was still missing…

Shadows! Realistic terrain should be casting shadows on itself. David's next move was to cook up an efficient algorithm for calculating the shadows on the terrain. Some users will not appreciate David's optimization because they will only be playing on existing maps with all the shadowing pre-baked into the terrain. However, for anyone in the map editing business (and we're trying to encourage as much Overgrowth modding and map editing as possible), this will save lots of time. The picture above shows off the results of David's self-shadowing terrain.

Just to be sure that the shadows lived up to the photo-realism captured by the rest of the Phoenix Engine, David fine-tuned his shadow calculation process to make a high detail pass over the terrain, producing the image above. The terrain as an isolated asset was now fairly complete. Now it was time to start work on some non-terrain assets but I will discuss that in a future developer diary.
For more information on Overgrowth development please visit the Wolfire Blog.
Man that stuff is looking really cool so far. Well Done!