I use the color of the vertex to decide which texture should be used and got 4 textures working:
Texture 1 : Red
Texture 2 : Green
Texture 3 : Blue
Texture 4 : Black
I tried to add the color White to gain a fifth texture, but this didn’t work because it behaved like a overlay on top of the other textures (Well, this could be expected…).
So my question is: how could I store more information into my vertics?
I found a shader that supported 8 diffuse textures, but I think that’s the limit. Anything more will have to emulate Unity Terrain’s splat map system (which I would love to clone for custom meshes).
The name of the shader is “TMG_8SplatShader_Diffuse”.
value is in the range of the red channel from 0.5 to 1.0, while value 2 is in 0.0 to 0.5. Both return 1 if the step function is true. How much performance it costs is a different matter.