pD3DDevice->SetTexture(0, pTextureBuffer[0]);
pD3DDevice->SetTexture(1, pTextureBuffer[texcat]);
pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
pD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
pD3DDevice->SetTextureStageState(1,D3DTSS_COLORARG1, D3DTA_TEXTURE);
pD3DDevice->SetTextureStageState(1,D3DTSS_COLORARG2, D3DTA_CURRENT);
pD3DDevice->SetTextureStageState(1,D3DTSS_COLOROP, D3DTOP_MODULATE);
pD3DDevice->SetStreamSource(0, pVertexBuffer[vtxcat], sizeof(VERTEX));
pD3DDevice->SetIndices(pIndexBuffer[vtxcat], 0);
pD3DDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, vtxnum, 0, trinum);
Currently this outputs a lightmap texture with a tint that is the general color of the wall. Making the lightmap the top layer and the bottom layer the texture results in blackness. Any suggestions?
Thanks
[edited by - aphelion on April 13, 2004 8:44:54 PM]
Multi-texturing Problems in DX8 (Lightmaps)
Hey,
I'm trying to render a black and white light map onto a textured wall, but I can't get D3D behave correctly. Here's my code:
It''s probably that you have one set of UVs and aren''t telling D3D to use the first set on the second stage.
pDev->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 0)
pDev->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 0)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement