Jon
03-11-2005 19:55:32
Splitting this off from the "splatting7" thread.
height[0]= 0
height[1]= Material heights[0]
height[2]= Material heights[1]
height[4]= maxTerrainheight
Thanks, I understand now and have played around with the cfg settings a bit. There are a couple of things I don't quite like about the way the splatting is done, so I'd like to check if there is a way to correct these before I dive in and make my own PagingLandScapeTexture subclass (although I'm dieing to give that a shot )
Before I jump into the list, I'd like to point out that my experiments were made with my own terrain data (not any of the distributed ones).
1. Sometimes splatting occurs where it shouldn't. By that I mean a cliff next to water has the water texture splatted a ways up the side of the cliff. Certainly the way splatting is supposed to work, but not what I wanted here. In this case an abrupt transition is desired. Certain textures like water don't seem to splat as well as grass/snow/sand.
2. Sometimes texture assignments shouldn't be based on height, but on (x,y) coordinate, or on slope (I'd love for the cliff to have a rock texture).
While slope isn't an attribute of a vertex, a polygon between vertices does get textured.
Now I understand that I could create a texture file which covered the entire heightmap, and what I'd like to do is a varient of this. What I don't want to do is to replicate the texture data in high resolution, or have a low resolution texture map applied to the terrain. (What I mean by this might be clear below).
So my ideal Texture class would process an texture map corresponding to the heightmap, where each coordinate would identify the desired texture and whether splatting was permitted.
If a vertex was not on a texture boundary, the specified texture would be used (i.e. an index of 1 would mean texture 1, which might mean rock.png).
If a vertext is on a texture boundary, and splatting is permitted, interpolation is performed as it is currently. If splatting is not permitted, the texture is applied as if the vertex was not on a boundary.
This would allow me to preprocess a heightmap and generate texture assignments offline. I think this would give me enough control over texture assignments
So the big question: are there tools to do this already in the plugin, or should I write my own?
PS: I think I'll finally have the time to go do a detailed study of the code. These last few days I've been busy with a couple of big problems not related to Ogre, but I think I have things under control now.