Original Post
I''m trying to figure out how to use multitexturing from the book Special Effects Game Programming with DirectX. It talks about how to do it, but for some reason gives no code samples about it. It seemed fairly straightforward, but when I try to do it modulating the color nothing is rendered, and when I try adding or subtracing color it is the same as if I only used the first texture. I''m trying to do light mapping - here''s my code:
g_pD3DDevice->SetTexture(0, m_Texture); g_pD3DDevice->SetTexture(1, m_LightTexture); g_pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); g_pD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); g_pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); g_pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); g_pD3DDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_CURRENT); g_pD3DDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_TEXTURE); g_pD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE); g_pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_CURRENT); g_pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAARG2, D3DTA_TEXTURE); g_pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_MODULATE); g_pD3DDevice->SetTextureStageState(2, D3DTSS_COLOROP, D3DTOP_DISABLE); g_pD3DDevice->SetTextureStageState(2, D3DTSS_ALPHAOP, D3DTOP_DISABLE); g_pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);I don''t know that it matters, but at this point I have alpha blending enabled, lighting disabled, and Z writing disabled. I know that both textures are valid, and when I set the same texture as 0 and 1 the same things happens, so the problem is probably something simple. Any ideas?