Skip to main content
GameDev.net gamedev.net
🔒 Locked

rendering polygons with alpha texture

Started by Lazy303 May 4, 2004 at 5:38 PM 1 replies 550+ views
Original Post
Lazy303
Lazy303
What render states do I have to set to be able to render ploygons with a texture with alpha channel? I use D3DFVF_XYZ|D3DFVF_TEX1 I tried this, but it didn''t work...

m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );		
		m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
		m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );		
		m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
SpaceDude
SpaceDude
You also need to enable alpha blending and set the blending type. There are some tutorials over at www.gametutorials.com on this.
Lazy303
Lazy303

aha... I think I forgot


m_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
m_pd3dDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
m_pd3dDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.