Advertisement

[DirectX8] Trasparency/opacity problem

Started by August 22, 2022 04:04 PM
3 comments, last by Geri 2 years, 4 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);
 

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

Advertisement

@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