🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

[DirectX8] Trasparency/opacity problem

Started by
3 comments, last by Geri 1 year, 10 months ago

Hello i'm trying to get opacity on a model, but this is what happening, as you can see whats under the opaque/transparent part is not showing, i want it to show what's under.

https://i.gyazo.com/b9f6e24f3cb5d88368c37ad9ff270fdc.mp4

STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
STATEMANAGER.SaveRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);

STATEMANAGER.SaveRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); 
 
STATEMANAGER.SaveTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);

STATEMANAGER.SaveTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);

STATEMANAGER.SaveTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);

STATEMANAGER.SaveTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);

STATEMANAGER.SaveTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);

STATEMANAGER.SaveTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
 
Advertisement

disable z write and render them after you rendered the normal objects. you might have to sort them by distance from camera.

@Geri So i render it normal , than i render it with alphablendenable?
should i disable z write on both?

obviously only on the alphablended

This topic is closed to new replies.

Advertisement