Charles Haro
Charles Haro

Reputation: 1886

Alpha blending 2D sprites in 3D space on windows phone with Xna 4.0

Hey all I'm trying to make a 3d game in with 2d sprite characters. I'm loading my sprites as plane models from blender with textures already applied.

I'm currently alphablending the sprites but it appears the meshes are only taking the background color and not the color of the sprites behind it. The picture below shows that I'm talking about.

https://www.dropbox.com/s/matk2urmnwtklrs/errors2.jpg

Is there anyway to properly alpha blend my images so that they appear correctly transparent? I'm currently looking up how to do alpha testing instead of alpha blending as I think that may help solve this issue as well; however, I need help on how to do this in code

Upvotes: 0

Views: 313

Answers (1)

dowhilefor
dowhilefor

Reputation: 11051

Have a look into the xna example for billboarding wich is the proper term if you need to search for more references. The most difficult part is the proper sorting, because you can't rely on the Z buffer. The example takes care of that You could also try the blend state BlendState.NonPremultiplied

Upvotes: 1

Related Questions