Jump to content
  • Advertisement
Sign in to follow this  
MasterEvilAce

Overlapping sprites with transparency

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

alpha.png

Using XNA 4.
I'm rendering a bunch of overlapping sprites to the screen based on a calculated layerDepth.
Any sprites that might conceal the player I draw with a transparent color in the draw function.
Is there a way to prevent visible overlapping edges in this scenario? (See corner block sides "doubling up" against the other transparent pieces)
Basically, I'd like the three partially-transparent walls to look like one object, without seeing the sides of the walls that you wouldn't normally see, if they were fully opaque.

Share this post


Link to post
Share on other sites
Advertisement
Nice graphics!

Anyway. One possible solution, you generate another 3 'blocks' yet the places where the overlap now you make half the opacity. You could then check when this situation occurs and hence replace the images with the 'half opacity' areas.

That's something I quickly thought up. But having it overlap doesn't look bad at all in my oppinion.

Share this post


Link to post
Share on other sites
I need to be able to do this all within one sprite batch, due to render order and performance issues.
I've been looking into BlendStates trying to figure this out, but there is a severe lack of tutorials / understanding on my part. I have to use the XNA "Reach" profile which seems to have some limitations on BlendState settings (unsure if this should affect what i'm trying to achieve.)

Basically, the objective (I believe) is basically to only draw the latest partially-transparent, if there are multiple transparent pixels at the same location. But figuring this out is tough without a good understanding.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!