3D surface alpha causing weirdness

Blitz3D Forums/Blitz3D Programming/3D surface alpha causing weirdness

Craig H. Nisbet(Posted 2004) [#1]
I have a 3d model I converted with LWConvert to B3D. It has a alpha in the main surface, but when I use the surface in alpha mode, it's like the zbuffering on the polys gets messed up. It's like the polys are rendering in reverse. They're not flipped though. Any ideas?


N(Posted 2004) [#2]
Alpha + Polygons == The equivalent of loss of bowel control for polygons.

Actually, if the polygons are at the same position then it'll be ordered in order of triangle index. I'd have to see the model to actually attempt to know what's wrong.


Damien Sturdy(Posted 2004) [#3]
i have this exact problem.... one hell of a weird one...


Beaker(Posted 2004) [#4]
Polys are drawn in creation order, and with alpha are not tested against the z-buffer. Simple as that. You need to sort them so they draw in the correct order.

It may or may not help but take a look at my Alfa Zorder in the code archives:
http://www.blitzbasic.com/codearcs/codearcs.php?code=850


Damien Sturdy(Posted 2004) [#5]
why on earth IS that, anyway??? is it a huge bug?


N(Posted 2004) [#6]
No, it's not a bug. It's just that Blitz3D isn't going to sort them for you. Doesn't take much to sort the polygons based on distance from the camera, just get the distance of'em all (or all those that are facing the camera) inside an array then run a quicksort on it. It's what I do for a great deal of my stuff that uses alpha blending (vertex alpha, typically, but it's generally the same result to me).


AdrianT(Posted 2004) [#7]
yeah its not a bug exactly, just something that blitz doesn't support too well. Just about every engine I have used had similar issues just not as prolific, and often you could set a sort order in the z buffer for a mesh which was a bit better than no real z sorting at all, which seems to be what blitz has.

dob't really understand this stuff much myself though :)


skidracer(Posted 2004) [#8]
There is a faq entry you may find useful:

[faq 32]