GlobalDirect3D9Device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
GlobalDirect3D9Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR);
GlobalDirect3D9Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR);
GlobalDirect3D9Device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
GlobalDirect3D9Device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
GlobalDirect3D9Device->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
How can I achieve this effect...
Hello. I have a texture which is drawn with these states:
Is there some programatic way to fade this to invisible? Or even a fade to black would do. I need to be able to achieve this without using any alpha. For example, is there some way to modulate the first colorarg with an external number, such as the TFACTOR variable?
Thanks for any pointers on this one.
Mark
Quote:Original post by mrmrcoleman
[...]such as the TFACTOR[...]
Why not actually *use* TFACTOR ;)
[source lang=cpp]float f = 0.5f;pDev->SetRenderState( D3DRS_TEXTUREFACTOR, D3DCOLOR_COLORVALUE(f,f,f,f) );pDev->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );pDev->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR );pDev->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE );
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement