Advertisement Jump to content

Archived

This topic is now archived and is closed to further replies.

Aphelion

Multi-texturing Problems in DX8 (Lightmaps)

This topic is 5397 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:

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]

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!