setting render states for transparent objects

Started by
0 comments, last by DesignerX 19 years, 4 months ago
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?
I currently only use c# and directX9, in case its relivant and i didnt mention it in the post
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
There is nothing that can't be solved. Just people that can't solve it. :)

This topic is closed to new replies.

Advertisement