• Advertisement
Sign in to follow this  

Lighting messed up after texture

This topic is 4580 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

I have a simple sphere and a backdrop bmp as the background If I don't add a tecture the color(1.0,1.0,1.0,1.0) is white. correct. but as soon as I add the background pic its blue. Whats wrong? TextureCode m_pd3dDevice->SetTexture(0, ppTextureBackground ); m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); m_pd3dDevice->SetFVF(FVF ); // new in DX9 m_pd3dDevice->SetStreamSource( 0, m_pVB, 0, sizeof(VERTEX) ); m_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLEFAN, 0, 2); please help. nick

Share this post


Link to post
Share on other sites
Advertisement
You've told D3D to just take texture color, and nothing else (via: SELECTARG1, and ARG1=TEXTURE).

To mix in lighting you'll want the COLOROP to be MODULATE (multiply), ARG1 to be TEXTURE, and ARG2 to be DIFFUSE (output from vertex lighting)

Share this post


Link to post
Share on other sites
After the texture is done with draw primitive do I need to clear the texture before I do my meshes?

Share this post


Link to post
Share on other sites
you wouldn't have a code snippet so I could see how it relates would you? I'm confused.

Share this post


Link to post
Share on other sites
Okay I finally got it to work.

Does anyone know of links that thoroughly explains textures and stages from the ground up and stays pretty simple?

Nick

[Edited by - nick5454 on July 9, 2005 9:57:44 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement