Original Post
Hello, Can someone please try to explain to me how multiple textures can be blended per alpha on a face with D3DX? I've been reading and searching, repeat x 5 on this and I still just don't see how it's done. I'm working with terrain, and I've already been able to box filter for smoothness, sectorize for performance with larger heightmaps, and colorize vertices based on elevation, etc. I have a fairly good idea on how the texture stage settings work, and I've been able to "overlay" a detail texture onto a base texture with no problem, since this is simply merging two textures across the faces entire surface. What I want to be able to do is blend from one texture to another within the same face, based on alpha values. I've read countless articles and tutorials on doing this, but the problem is that they all say to just store an alpha value for each texture type per vertex, then the texture blending stages will take it from there, basically. It certainly makes sense and it looks fantastic on paper, but implementation is a different story, for one reason... The supported vertex structures in D3DX only contain one alpha setting per vertex, which of course is in the diffuse. I have no way of storing different alpha values for the vertex. I could make use of the specular component to store one more alpha value, but not only is that a crude workaround, it also still only allows two textures, which obviously isn't going to work for a nice terrain. I hope I'm making sense with this and that someone can shed some light on how this should be done. Thank you very much in advance, Scorp