Friday, January 20, 2006

Cube Maps

I've been using cube maps for various things in my shaders lately. I'm especially excited about high dynamic range cube maps because of the nice image quality they give both when used to light objects and also when used for reflections. Now that both Max and Photoshop support 16 bit float images, HDR cube maps are pretty easy to make - especially since the Nvidia DDS plugin for Photoshop can save a dds cubemap in 16 bit float. The pipeline for using cube maps is getting better.

About a month ago, Jolyon Webb from CodeMasters told me about a new tool from ATi that makes working with cube maps even easier. It's called CubeMapGen. It will read in a verticle cross HDR cube map right out of HDRshop and save it in 16 bit DDS format. That means that you don't even have to use Photoshop at all and you no longer have to hand-place the six panels of the cube. This new tools turns the process of creating a cube map into just two steps. First, convert a light probe into verticle cross format in HDRshop and save it. Second, open it in CubeMapGen and resave in 16 bit DDS format. That's it! You can also give it the 6 sides as seperate images if you want to.

Another really nice thing that it does is handle mip-map generation and filtering correctly for a cube map so you never see seams in your cube map no matter what mip-level you use. Nice! You can grab this tool here:

http://www.ati.com/developer/cubemapgen/index.html

I'm working on a new tutorial about using cube maps for real-time global illumination. It probably won't be done for awhile since I don't have a lot of extra time to work on it, but I'm planning on explaining how this tool fits into the process