Sign in to follow this  

Multitexturing problem

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

This topic is 4694 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this