Wednesday, November 25, 2009

Adventures in virtual texture space, part 16

The last couple of days I've been cleaning up some parts of my code and preparing for when I can add variable sized compressed pages, which may or may not include normal and specular maps.

Unfortunately my code wasn't build with that in mind, and now it'll take some serious refactoring work to make my mip generating code work with it.

What really annoys me is that if only one tiny sub-page in a higher mip page has a normal map, then the entire mip page will need a normal map too.
Sure, it'll compress nicely, but I can imagine that this will complicate rendering, that you may or may not have a normal map at a texel basis.
I suppose this will have to be handled either at a per mesh level, or just give everything a default normal map.
I'm probably going for option no. 2 because it'll be safer and simpler.

Besides, I need to reserve the texture for it anyway.

Also tweaked my algorithm to combine polygons a bit, and I'm now using fewer pages for the same geometry.