Page 1 of 1

Black boxes on alpha bitmaps

Posted: Thu Oct 30, 2014 12:54 pm
by Imerion
I have tried to create halo-like effects around objects in my game by using a translucent sprite. But for some reason it renders black boxes around each object, hiding other sprites but not 3D objects.

The bitmap used for the halos has an alpha layer, so it should be just a circle. The material has blend mode set to alpha/one. Specular and emission is on 0, no shininess, zbuffer on, backface off.

At first I thought this was a problem with my graphics drivers, but I have now tested it on several computers and all render the same. I have tried most options I could find, but haven't found a solution. Something I could have overlooked?

Re: Black boxes on alpha bitmaps

Posted: Thu Oct 30, 2014 1:14 pm
by Kjell
Hi Imerion,

When rendering using a semi-transparent material with Z-Buffer ( writes ) turned on, you need to make sure to render back-to-front. A easy solution could be to turn Z-Buffer off, or use the Model.RenderOrder = DepthSorted option .. but neither might give you the desired results.

Could you post a screenshot or short video of the problem? That makes it easier to suggest a solution that works best for you specific situation.

K

Posted: Fri Oct 31, 2014 12:43 am
by Imerion
I have tried playing around with those settings, but it didn't help. I use depth-sorting for most objects.

I have included a screenshot of the problem. Perhaps it can help. All I want is that those black areas around each halo should be completely transparent.

Posted: Fri Oct 31, 2014 12:27 pm
by Kjell
Hi Imerion,
Imerion wrote:I have tried playing around with those settings, but it didn't help. I use depth-sorting for most objects.
There are some other aspects that control / determine the order in which things are rendered .. so it's a bit difficult to guess what's causing it.
Imerion wrote:I have included a screenshot of the problem. Perhaps it can help. All I want is that those black areas around each halo should be completely transparent.
It appears that your sky ( stars & purple nebula ) is being rendered after the astroids, while you want this to render before any overlapping semi-transparent things. Try disabling DepthSorted on your sky model and make sure to spawn it first ( so before any other models ).

K

Posted: Fri Oct 31, 2014 1:51 pm
by Imerion
Ah, that took care of it! The background model is now using standard renderorder and is spawned first. Looks as it should now! Huge thanks again!