• Advertisement
Sign in to follow this  

Using an overlayed alpha map to clear pixels.

This topic is 3763 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, I've been struggling with this for a couple of hours. I'm basically drawing an empty texture with each pixel set to ARGB(0,0,0,0) over the top of another textured quad. I want to use the alpha channel of this clear texture to make sections of the textured quad become transparent, but I don't want the clear texture to be drawn at all obviously. I just can't figure out the RenderStates I need to make this happen as every one I try just draws the supposedly clear texture black with varying levels of opacity from the alpha channel. I'm currently setting the states like this but I've tried every combination I could think of.

m_pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
m_pDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
m_pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_DESTALPHA);
m_pDevice->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_TEXTURE);	


Is this possible using RenderStates, etc, like that or am I going to have to use some other method? Thanks for any help. Cheers.

Share this post


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

  • Advertisement