Separate Rendering on Fixed Pipeline

Started by
1 comment, last by SoRich 20 years, 6 months ago
Hello all. I have 2 textures with color and some alpha chanel data. And i must to blend it in next way some factor; result.color = tex1.color * (factor) + tex2.color * (1- factor) result.alpha = tex1.alpha * (factor) + tex2.alpha * (1- factor) Anybody know, can I did it on fixed pipeline? Thanks in advanse! Andriy Sorich
Advertisement
Sure. Check out the mfctex example.

You want to use SetTextureStageStat() to set multitexture blending (modulation, addition, etc). You can do this independantly for the rgb channels and alpha channel. For the factor, check into D3DRS_TEXTUREFACTOR and D3DTOP_BLENDFACTORALPHA.

---
http://www.gapingwolf.com
--- - 2D/Pixel Artist - 3D Artist - Game Programmer - Ulfr Fenris[[ Gaping Wolf Software ]] [[ GameGenesis Forums ]]
Yes.
I''m doing so, but it looks strange:
SD3dDeviceI->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);		SD3dDeviceI->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);		SD3dDeviceI->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);		SD3dDeviceI->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, TRUE);		SD3dDeviceI->SetRenderState(D3DRS_SRCBLENDALPHA, D3DBLEND_ONE);		SD3dDeviceI->SetRenderState(D3DRS_DESTBLENDALPHA, D3DBLEND_ONE);		SD3dDeviceI->SetRenderState(D3DRS_TEXTUREFACTOR, factor);		SD3dDeviceI->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);		SD3dDeviceI->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);		SD3dDeviceI->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_BLENDFACTORALPHA);		SD3dDeviceI->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE);		SD3dDeviceI->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT);		SD3dDeviceI->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);		SD3dDeviceI->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);		SD3dDeviceI->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_BLENDFACTORALPHA);		SD3dDeviceI->SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_CURRENT);		SD3dDeviceI->SetTextureStageState(1, D3DTSS_ALPHAARG2, D3DTA_TEXTURE); 

This topic is closed to new replies.

Advertisement