Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

RelisH

Alpha Blending

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

I have two faces, and let''s say each one has a fireball texture. I want them both to blend in, but the problem is that when I do it in directX, I need to know which face is in the back, otherwise it doesnt blend the face correctly (eg, if I draw the one in the front first and then the one in the back). How do I fix this problem?

Share this post


Link to post
Share on other sites
Advertisement
I''m not sure if I understand your question properly, but you may be talking about a z-buffer issue when alpha polys overlap.

In the engine for my next book I turn off z-write capability when drawing the trees for the RTS game example. This puts the trees in the proper place Z-wise but also allows them to blend together.

Use the following to turn off z-write:

pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE );

You can then turn it back on after your alpha polys are done with:

g_pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );

Sorry in advance if that is not what you are asking.


LostLogic
www.lostlogic.com
Author, Multiplayer Game Programming

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!