Original Post
Hello people. I wrote some code to show a mesh over the screen, using the DrawIndexedPrimitive(). Now, this mesh is loaded from a file, so it has its own materials, diffuse colors and maybe alpha values different from 255. My problem is, I need to draw this mesh, but with an altered alpha value. For example, I want the mesh to fade out. I wrote this code: Being the texture factor 0, I expect the mesh to be completely invisible, or at least different from usual. But it shows as it would if I remove all the code after SetTexture()... Any help is greatly appreciated :)
m_dev->SetTextureStageState (0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
m_dev->SetTexture (0, m_pmMaterial.txTexture);
m_dev->SetRenderState (D3DRS_ALPHABLENDENABLE, TRUE);
m_dev->SetRenderState (D3DRS_TEXTUREFACTOR, 0x0);
m_dev->SetTextureStageState (0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR);
m_dev->SetTextureStageState (0, D3DTSS_ALPHAOP, D3DTOP_BLENDFACTORALPHA);