Original Post
I was reading the article on texture splatting and when I implemented it the fixed-function way, all I could see was my base texture. Here is my texture setup code: Does anyone know how to fix this?
g_pD3DDevice->SetTexture(0, groundTexture[0]);
g_pD3DDevice->SetTexture(1, alphamap);
g_pD3DDevice->SetTexture(2, groundTexture[1]);
g_pD3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
// Alphamap: take the alpha from the alphamap, we don't care about the color
g_pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
g_pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
// Texture: take the color from the texture, take the alpha from the previous stage
g_pD3DDevice->SetTextureStageState(2, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
g_pD3DDevice->SetTextureStageState(2, D3DTSS_COLORARG1, D3DTA_TEXTURE);
g_pD3DDevice->SetTextureStageState(2, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
g_pD3DDevice->SetTextureStageState(2, D3DTSS_ALPHAARG1, D3DTA_CURRENT);
g_pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
g_pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
g_pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);