Multitexturing problem

Started by
2 comments, last by Namethatnobodyelsetook 19 years, 2 months ago
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 !!
Advertisement
What does "MaxSimultaneousTextures" say? I believe a GeForce2 is limited to 2 textures.
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 !!
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.

This topic is closed to new replies.

Advertisement