EntityOrder issue

BlitzMax Forums/MiniB3D Module/EntityOrder issue

AdsAdamJ(Posted 2009) [#1]
Forgive me if this issue is ancient, I can't find anything about it through search. Anyway, I've tried this with both MiniB3D and Blitz3D and both have the same issue, I'm posting it here though I wanted to get acquainted with the rather nice miniB3D.

Take a look at Mr Planet here:



The rings are supposed to go around the planet, not in front. When the entity order isn't manually set, it displays correctly. Only when I set it to a positive value (to ensure it's drawn first), does it give me issues.

I could avoid using EntityOrder and put the planet a long long distance away and scale it up appropriately, but that's going to introduce it's own problems I think...

Am I doing anything wrong here? Is that a limitation of using EntityOrder? The code isn't worth posting, it's easily recreated with a few lines of code to load the objects in and set the orders.


EDIT: FYI, this is converted from a Lightwave model I made. I made several versions, one with the ring surface being two-sided, one with single-sided rings, duplicated and placed upside down below the original (faking double-sided) and also with the rings in the same and different layers with no luck.
EDIT 2: Setting EntityFX to 32 (Force Alpha Blending) seems to fix it in Blitz3D but not miniB3D. Hmm.


ima747(Posted 2009) [#2]
I assume both the planet and ring are set to the same entityorder value... I've had some problems with entity order recently specifically with transparent sprites. with solid sprites I never have problems. I think the transparency is at the root of the problem.

Personally in your instance I would try to make the ring and planet properly scaled to each other rather than trying to fake it with entity order. If your numbers are getting too big you could always scale everything down to a tenth it's former size and you only lose 1 decimal's worth of precision, which if you've got big numbers is probably not going to be an issue... but that may not be practical for you.


Zethrax(Posted 2009) [#3]
In Blitz3D, changing a mesh's EntityOrder disables z-buffering for it. Not sure if the same is true of MiniB3D, but it may be the reason the render is screwed up.


Floyd(Posted 2009) [#4]
I don't see how EntityOrder could possibly solve this.

If viewed from a "shallow" angle part of the ring is behind the planet and part is in front.


AdsAdamJ(Posted 2009) [#5]
Ah, I think I've found a solution to the problem that avoids using EntityOrder completely.

Instead, I've created a pivot to attach my background objects to and a pivot for the active game objects.

By changing the CameraClsMode so it doesn't clear the screen before a renderworld, I can render each group of objects separately by hiding and showing the pivots and doing multiple renders. Seems to work in a test I did, now for the game itself...

EDIT: Win! The pivot/hide/show method works: