Skip to main content
gamedev.net
🔒 Locked

Transparency

Started by Dtag Dec 10, 2002 at 7:33 AM 2 replies 250+ views
Original Post
Dtag
Dtag
Hi I am rendering a particle system in my engine. The particles are sprites that are Black and White in original. The white is supposed to be the visible thing. But the transparent parts of the particles overwrite the colored parts of other particles. Can anyone tell me what might be wrong? Iam currently using these Transparency Renderstates: m_pD3DDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_INVSRCALPHA); m_pD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_SRCALPHA );
S1CA
S1CA
A few guesses (since you haven''t provided enough information to do anything other than guess):

1) You have Z buffer writes turned on when rendering the transparent stuff. Set D3DRS_ZWRITEENABLE=FALSE for that stuff.

2) You haven''t enabled alpha blending. Set D3DRS_ALPHABLENDENABLE to TRUE for that stuff.

3) Your TEXTURESTAGESTATES aren''t set up to pass the alpha from the texture through to the frame buffer blending stage.


--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
Dtag
Dtag
Hi S1CA thanks for your answer...

1) I do have a ZBuffer turned on... Turning it off does work but i can see my particle effects through walls then which is not what I want.
2) Yes its enabled
3) Hmmm how can I check that?

Thanks
Dtag
Dtag
Sorry I didnt read your answer properly... After disabling the D3DRS_ZWRITEENABLE Renderstate, it worked. Thanks alot for your help!: )

Topic Locked

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

Sign in to reply to this topic.