Sunday, January 11, 2009

Improved shadows

Alexey has spent some time lately improving both the shader and shadow support in Ember. The shaders for both the terrain and the regular meshes have been reimplemented in GLSL and have had a nice slew of improvements added to them. One of the most exciting feature is proper support for real time shadows.

One of the issues we've been having is that regular texture shadows tends to result in very low res and jagged shadows when used with a large scene such as our outdoor scenes. This is because the texture that is used can only be so large, and the outdoor scenes makes it hard for the shadow system to setup the most optimized camera setup for the shadows. However, thanks to the new support in Ogre 1.6 for PSSM shadows, which basically is a technique where multiple shadows maps are used for variable distances, we now have the option of having shadows that looks good both up front and in the distance.
Alexey has already done a great job in adding support for this, which can be seen in these videos showing off the shadows. Note that they are still a work in progress, so some things such as taking texture alpha into account or shadowing of normal meshes are not yet implemented.

Some more videos can be found over at YouTube.

There are still some work to be done, but the shadows are already looking mighty nice. Of course, lower end machines won't be able to take advantage of this, and one of the things that we need to work on is better support for fall back materials.

No comments: