Compare this to the splatting example from the L3DT wiki:
or the top Google Image Search result for "terrain splatting":
Those transitions between terrain types are much smoother than mine. Is my problem simply that the alpha maps exported from L3DT are too low-resolution? I'm using "alpha express" export, which generates alpha maps the same resolution as the attribute map, which is all the detail that exists. So the alpha map resolution is the same as the heightmap resolution. I'm a little dubious that that's the problem, since I've looked at literally hundreds of splat terrain example images from other sources, and none seem to show this problem I'm getting.
Maybe the problem is the hard edges in the alpha maps? Here's a magnified version of part of mine:
It may be hard to see here, but every pixel is either solid red, green, blue, or black. There's no smoothing or blurring, no alpha map pixels that are blue-green, etc. Should there be?
Is it just my choice of textures - too much contrast between white snow and everything else? It's true the rock-to-grass transition in my screenshot isn't as jarring as snow-to-grass. But that Google Image Search result has a high-contrast transition between sand and grass, and still looks quite smooth.
Is my splat fragment shader too naive? It just sums the terrain textures using the alpha map values. Maybe there's something fancier I could here, like a noise texture or procedural noise to fuzz the edges somehow?
- Code: Select all
vec4 alphaMap = texture2D(alphaMapTextureSampler, texCoord1);
vec4 outColor = alphaMap * texture2D(type1TextureSampler, texCoord0);
outColor += alphaMap * texture2D(type2TextureSampler, texCoord0);
outColor += alphaMap * texture2D(type3TextureSampler, texCoord0);
outColor += alphaMap * texture2D(type4TextureSampler, texCoord0);
If you've implemented terrain splatting before, how did you approach it to avoid the blockiness I'm seeing?