The totally awesome TerrainFourLayer shader is currently set up to use an RGBA texture to determine the strengths of each of the textures. I wonder if if would be possible to accomplish the same thing using only a grayscale heightmap texture. Basically, the blending wouldn’t be determined by individual channels of the mask, but instead by the lightness of the heightmap. For example, pure black would be entirely texture1 while pure white would be entirely texture4, with intermediate values being mixtures of them. I’m just learning shaders and I’m having a hard time modifying the TerrainFourLayer shader to do what I want. Is what I’m going for possible?
This is definitely possible, although I believe it would be more efficient to pre-compute the mixing mask based on height yourself, rather than to use grayscale at runtime. You have to have a mixing texture in there anyway, and due to the parallel nature of graphics cards, you won’t see a speed boost from using one channel instead of four. Your memory usage will go down a bit, but I doubt it’s worth it.