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… ^^’

setColourOperationEx maniac!

I can only manage 2 textures for now, but my texture recipe is clean. I need very slow transitions, while very detailed textures. I think I’m OK with this quality.

The basic material uses from 6 to 8 texture units (#3+4 are optional, only for maximum splatting quality).

// down texture
0->setColourOperationEx(LBX_SOURCE1,LBS_TEXTURE);

// down texture details
1->setAlphaOperation(LBX_SOURCE1,LBS_CURRENT);
1->setColourOperationEx(LBX_BLEND_TEXTURE_ALPHA, LBS_CURRENT,LBS_MANUAL,zero,zero);

// base alpha
2->setAlphaOperation(LBX_SOURCE1,LBS_TEXTURE);
2->setColourOperationEx(LBX_SOURCE1,LBS_CURRENT);

// detailed alpha 1 (optional)
3->setColourOperationEx(LBX_SOURCE1, LBS_CURRENT);
3->setAlphaOperation(LBX_ADD_SMOOTH, LBS_TEXTURE,LBS_CURRENT);

// detailed alpha 2 (optional)
4->setColourOperationEx(LBX_SOURCE1, LBS_CURRENT);
4->setAlphaOperation(LBX_MODULATE, LBS_TEXTURE,LBS_CURRENT);

// up texture
5->setColourOperationEx(LBX_BLEND_CURRENT_ALPHA, LBS_TEXTURE,LBS_CURRENT);
5->setAlphaOperation(LBX_MODULATE,LBS_MANUAL, LBS_CURRENT,detail_alpha);

// up texture detail
6->setColourOperationEx(LBX_BLEND_CURRENT_ALPHA, LBS_TEXTURE,LBS_CURRENT);

// lighting
7->setColourOperationEx(LBX_MODULATE, LBS_DIFFUSE,LBS_CURRENT);