Original Post
I am currently working on the 3D terrain for my Game and I read a great article called "Texture Splatting in Direct3D" by Nate Glasser. I am writting the app in C# Using Managed DirectX 9.0 (Oct 2005 Update).I started to implement the technique in my game, but I ran into some problems. I have a 3D Primitive object that I use to represent my terrain. I am using one file that contains a grass texture and another file that contains the alpha mask. The alpha mask is a 32-bit tga file with the alpha on the RGB and the Alpha channel. Here's what I am getting as output. The alpha texture is being rendered to the terrain and it looks like the grass texture is being ignored. Anyone have any ideas where I am going wrong. Here's my code I am adding the alpha to texture stage 0 and the texture to stage 1: this.m_dxTextures[0] = sAlpha; this.m_dxTextures[1] = sText; Then I am setting the texture stage. GrafixEnv.Device.SetTextureStageState(0, TextureStageStates.AlphaOperation, TextureOperation.SelectArg1); GrafixEnv.Device.SetTextureStageState(0, TextureStageStates.AlphaArgument1, TextureArgument.TextureColor); GrafixEnv.Device.SetTextureStageState(1, TextureStageStates.ColorOperation, TextureOperation.SelectArg1); GrafixEnv.Device.SetTextureStageState(1, TextureStageStates.ColorArgument1, TextureArgument.TextureColor); GrafixEnv.Device.SetTextureStageState(1, TextureStageStates.AlphaOperation, TextureOperation.SelectArg1); GrafixEnv.Device.SetTextureStageState(1, TextureStageStates.AlphaArgument1, TextureArgument.Current); I am also setting the following renderstates. GrafixEnv.setRenderState(RenderStates.AlphaBlendEnable, true); GrafixEnv.setRenderState(RenderStates.SourceBlend, (int)Blend.SourceAlpha); GrafixEnv.setRenderState(RenderStates.DestinationBlend, (int)Blend.InvSourceAlpha);