071019 / Cubemap Woes

previous | next

Cubemaps rule! Cubemap mipmaping sucks!

The problem is that the hardware doesn't filter across the ends of each cube. The 1 pix texture border option fixes this by allowing the clever programmer to provide extra texels so the filtering works out ok. Great, so canned static mipmapped cubemaps are golden. Dynamic generated mipmaped cubemaps is in a sorry state however. First glGenerateMipmapEXT() won't do correct mipmap generation around the seams. Second, and the show stopper, even the latest NVidia cards don't support attaching a cubemap with borders to a framebuffer object. The GL_FRAMEBUFFER_UNSUPPORTED_EXT laid down the law, no way to draw into mipmaped cubemaps with borders!

What to do Now

The only option is to manually blend the edges of all the cubes in the mipmaps so that they are the same. Basically trade a possible high contrast fine line on the seam with double width pixels. Rounds out the edges of the cubemap. Should work fine for the environment map, but sure breaks what I had in mind for ray tracing. Will have to rethink some of this...

A Random Thought I Don't Want to Forget

Was watching a cool show on ants a few days ago, specifically how their collective decision making works. Basically they leave chemical bread crumbs, other ants follow the trail, strongest chemical trail wins. Different chemicals to pass different messages to other ants. Might be something which could make a really interesting game AI.