Sunday, November 25, 2007

In the shadows

The new terrain rendering system is working really nice and I've now fully integrated a shader based terrain material. The idea is to optimize the material by trying to reduce the number of passes needed. By combining the different coverage layers into one single texture we can keep the number of passes down. On my card with 16 texture units I can squeeze in 12 splatting layers in one pass.

Now that I've got that part done I'm working on getting some more advanced features such as normal mapped terrain working. There are a couple of performance issues to take into account though. There's no reason to render the terrain with normal mapping on when it's in the distance. I'm thinking of adding some features which will allow the engine to automatically create pre-baked textures for the distance, where all of the layers already are put together without the need for splatting.

On the media front, Jayr continues to bring out really nice media. He's reworked the two room house, the gallows, the jetty and the stalls. Most of these are already brought into Ember, with full support for normal and specular mapping.

Wednesday, November 07, 2007


I've finally started redesigning the terrain system, with some very promising result. The first issue to tackle was how the shadows on the terrain were computed. Previously I left all of that to the scene manager, which used a simple vertex lit approach which didn't look good with lower LOD (and also taxed the GFX card as the shadows had to be recalculated each frame).
I now have a simple shadow generation framework in place. The idea is to provide a couple of pluggable shadow providers for different shadow techniques. Currently I only provide a very simple technique where the shadows are calculated directly from the surface normals (just as vertex lightning). It already looks much better than before though, although I intend to provide some more advanced techniques later on.
Here are some example screenshots:
I've also started on a more thorough refactoring of how the whole terrain system works. The goal is to more easily allow for more advanced features, such as normal mapped terrain, as well as being able to alter the terrain materials in a simple gui ingame. As with all refactoring the code is currently a mess, but yesterday at least I got it to compile. The blueprint for this can be found here and I've so far followed it pretty much to the letter. The material compiler works, though it's very inefficient in the way it creates new materials.

Jayr have been churning out even more great looking media with a lot of new normal maps. It's a real joy to update the material definitions and see how the world comes to life when normal mapped materials are used. It's really such a big change in how everything gets depth and shadows.