Splatting: done!

I got finally my own splatting working. Here is the rendering while flying approx. 2000 meters high. I still need to generate the whole texturing of planets, but I’ve got definitively my 256 textures system working.

I always benchmark any of my functions and I was quite surprise of dynamic texture generation time, not what I expected. Either I didn’t understood clearly enough mode definitions, or there is some drivers issues!

Ogre::HardwarePixelBufferSharedPtr pixelBuffer = mDynTexture->getBuffer();
// pixelBuffer->lock( Ogre::HardwareBuffer::HBL_DISCARD ) ;    // slow version
pixelBuffer->lock( Ogre::HardwareBuffer::HBL_NORMAL ) ;   // Fast!

Tiles puzzle

I’m still working on alpha texture generation. The splatting of two textures is child-proof. But upgrading this to mix dozens or hundreds of textures for a whole planet is… rather… painful!

Because of differents LOD for tiles, there is 2^16 (65536) different alpha combinaisons. No way to keep a such amount of textures in memory, of course. Dynamic creation itself is simple as possible: a basic texture alpha, then a bunch of memcpy(). But the thing is to create splitted alpha map. Like unpredictable portion of the terrain, at any scale.

I never been a puzzle game addict… ^^’