Texture splatting does not work
Hi all!
I tried to implement texture splatting and i think i have done everything right. So i set the alphablend to true and set the texture stages correct. But it does not want to work... The whole terrain just gets rendered without alpha so i cant see what i make wrong.
device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
device->SetTexture(0, alphatexture);
device->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
device->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE);
device->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
device->SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_CURRENT);
device->SetTexture(1, texture);
dev->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, nrVerts, 0, nrTris);
What could i make wrong? Thank you very much!!!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement