Terrain Texture Splatting???

Blitz3D Forums/Blitz3D Programming/Terrain Texture Splatting???

Well, I tried this theory out and I've encountered several issues with vertex alpha. Here is my test program (it is REALLY CRAPPY CODE because I was just kludging on the fly, trying out the theory, so BE NICE!). (Textures/Heightmap included)

http://mywebpages.comcast.net/hnorse1/test_splatting.zip

The docs say you must set EntityFX with 32 to get vertex alpha to work. I found that I also had to set flag 2, Use Vertex Colors, also.

I have two surfaces. The primary surface containing the base texture, and the second surface that has a patch or splatting texture. Order is really important. You need to add the splatting surfaces first or it won't show up. Hence the butchering of my code. Obviously in a real splatting code you would create the splats based on height and slope.

Anyways, it seems that the primary Surface now has some transparency although all of its vertices have vertex alpha set to 1.0! Move the camera left and right, you can see through hills.

Also, I originally was contemplating unwelded vertices and being unacheivably skillful at setting their uv coords to map a single combination texture to all the splats. Only one surface, ooh, ahh! But it dawns on me that without layers, what would it blend with??? Duh!

I have a real reservation about this approach because it will require probably a minimum of 3 surfaces, if not four, to get the appropriate terrain detail, as Shawn mentioned previously. If this were a single static terrain mesh, that would be OK. But with a tiled terrain engine, you will now have 3-4 surfaces per tile - easily 300-1000 surfaces. That Won't work! The option is to make the tiles bigger and have less tiles, but for Dynamic Level of Detail, you can only get away with rebuilding tiles 32x32 in real time. Also, I would also now have to rebuild all of the surfaces for the splats. Sure would be nice to have a deletetriangle command without clearing the entire surface.

Now that I think about it, I was reading an article that suggested splatting only the near tiles and using a colormap and single detail texture for far tiles, since detail far off in the distance won't be important. That would reduce the number of surfaces dramatically, especially if it was limited even more to only the tiles in the view area (EntityVisible).

Anyways, anyone else have any ideas, input, theories, suggestions, solutions, innovations, inspirations, contemplations, ascertations, interpretations...

Thanks,
MK