Jump to content
  • Advertisement
Sign in to follow this  
r@ph

Multitexturing problem

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

Hi all, I have a strange problem with multitexturing. I want to blend 3 textures so here is my code d3d::gd3dDevice->SetTexture(0, gShadeTex0); d3d::gd3dDevice->SetTexture(1, gShadeTex1); d3d::gd3dDevice->SetTexture(2, gShadeTex2); d3d::gd3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); d3d::gd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); d3d::gd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_CURRENT); d3d::gd3dDevice->SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, 0 ); d3d::gd3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE); d3d::gd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE); d3d::gd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT); d3d::gd3dDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 1 ); d3d::gd3dDevice->SetTextureStageState(2, D3DTSS_COLOROP, D3DTOP_MODULATE); d3d::gd3dDevice->SetTextureStageState(2, D3DTSS_COLORARG1, D3DTA_TEXTURE); d3d::gd3dDevice->SetTextureStageState(2, D3DTSS_COLORARG2, D3DTA_CURRENT); d3d::gd3dDevice->SetTextureStageState(2, D3DTSS_TEXCOORDINDEX, 2 ); I have checked my device capacity (geforce2MX) with MaxTextureBlendStages and I get 8 The problem is when I comment the last 4 line it is ok. http://r.nury.free.fr/2blend.jpg The model is black when they are not commented :-( http://r.nury.free.fr/3blend.jpg Thanks for your help !!

Share this post


Link to post
Share on other sites
Advertisement
Thanks for your reply

You are right I have checked "MaxSimultaneousTextures" and I get 2. :-(

Does anybody know a way of blending 3 textures on a geforce2 MX ???

Thanks for your help !!

Share this post


Link to post
Share on other sites
You'll need to use multi-pass rendering, and alphablending to mix them. Alphablending doesn't need to be based on alpha. For example, setting

SRCBLEND = DESTCOLOR
DESTBLEND = ZERO
ALPHABLENDENABLE = true

does a modulate between what's previously in the buffer (from pass #1) and what you're now rendering, which seems like what you're trying to do.

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!