Jump to content
  • Advertisement
Sign in to follow this  
fguihen

setting render states for transparent objects

This topic is 5129 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

ok, in 3DS max, i created a room, and one of the walls are glass, but when i export as a mesh and open it in my c# app, the wall becomes a solid gray rather than a transparent object. im told i have to set the correct render state to allow for transparent objects but i cant seem to figure out how this is done. can anyone explain?

Share this post


Link to post
Share on other sites
Advertisement
Try the following :

D3DSetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
D3DSetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
D3DSetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);

// Set desires texture stage states
D3DSetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
D3DSetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
D3DSetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);

D3DSetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
D3DSetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);

Read the SDK for the correct paramters u need incase this doesn't suit your purpose

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!