Thanks for your reply. I guess a picture says more than a thousand words, so I have uploaded one to this link:
http://yfrog.com/74shader1j[
^]
And anotherone, to show a bit more of the animation. The burning building and the smoke don't look very good as the particle effects just had started.
http://img409.imageshack.us/f/shader2.jpg/[
^]
Here can you see a test scene with some objects (they are the first I ever made with Blender and I'm not a great artist), some particle effexts after a building just got hit by some weapon and also the landscape object I want to replace.
Right now it's created from a height map, but I'm going to change that. In the future I want to have multiple landscape patches, organized in a Quadtree (landscapes are quite planar, so an Octree is probably not needed). This will help to render only the patches which are visible in the current frame. Also, more distant patches are going to be generated with a lower polygon count as a further optimization.
The landscape patch in the scene still is too large and has too many polygons. Up to now it uses four different textures. The blending weights are calculated by height, which you can see very clearly in the screenshot.
For the new landscape patches I will need to write some kind of editor which will allow me to set the heights (fitting to ajacent patches) and 'paint' the mesh with a selection of textures. Uniting the textures in one bitmap could also be done here.
Does it have a performance impact if I unite up to 16 1024 x 1024 textures in one 4096 x 4096 texture? Also, I know that texture widths and heights had to be powers of 2 on older GPUs. Newer ones don't have that restriction anymore, so it's a good question if that still is an issue or not.
2 x 2 textures would work, but a maximum of only four textures would still be a bit restrictive. 3 x 3 would be ok for most cases, but the width and height of the super texture would probably then have to be expanded to the next power of 2. 4 x 4 may be a better choice with even more textures and probably not much larger than the expanded 3 x 3 texture.
And last, I'm going to have to think about how many sets of texture coordinates and weights every vertex must have. The optimum would be 8, as every vertex has so many neighbors which all may have a different texture. I suspect such a shader will be a bit slow.