Game Development Community

Alpha Sorting problem in Particle Emitter

by Viren Thambidorai · in Torque Game Engine Advanced · 06/05/2008 (12:18 am) · 7 replies

Hi,

I am facing Alpha Sorting problem in Particle Emitter.

[remove][/removed]

Any suggestions for solving this issue ?

#1
06/09/2008 (12:01 am)
*BUMP* Any idea what might be the problem ?
#2
06/09/2008 (5:24 am)
Bounding boxes... Particle-emitters and other transparent objects are distance sorted according to the nearest point of their bounding box (axis-aligned, I think). I would guess that your picket fence is part of a larger object with a bounding box that sorts closer than the emitter's bounding box.
#3
06/10/2008 (8:46 am)
Yes, picket fence is a part of large object.

Is it related to this bug ?

www.garagegames.com/mg/forums/result.thread.php?qt=73786 ?

btw, I am using TGEA 1.0.3.
#4
06/10/2008 (9:09 am)
No, it's not related to the bug in:
www.garagegames.com/mg/forums/result.thread.php?qt=73786
That one is fixed in TGEA 1.7.0 (and it isn't present in 1.0.3).

While you could call it a design flaw or a poor implementation strategy, what you're looking at is not really a bug, it's just the way Torque sorts transparent objects and it fails in some situations like the one you've encountered. Aside from customizing the way Torque compares transparent objects, the quickest way to fix this is to manipulate the bounding-boxes to get the ordering you want.

One option is to separate out the fence object so that it has its own, tighter fitting bounding-box. Another would be to find a way to force the particle-emitter to use a larger bounding-box than the one it calculates on the fly.

[EDIT]
I still don't think that code was relevant in 1.0.3, but the bad comparison did exist there, but it may have been used differently. I'm checking on that...
#5
06/10/2008 (9:48 am)
FOLLOWUP:
I found the reason why the same comparison function that worked in 1.0.3 was bad in 1.7 and that is described in the thread:
www.garagegames.com/mg/forums/result.thread.php?qt=73786

I still think the problem here with the fence and the particle-emitter is not related to that bug.
#6
06/11/2008 (2:01 am)
I tried using smaller bounding box for fence but still no change.

Same problem is with vehicle damage smoke.
#7
06/16/2008 (9:50 pm)
Thanks Jeff,

I used both of above fixes and its working for most of the objects.


//ParticleEmitter::updateBBox()

   for (Particle* part = part_list_head.next; part != NULL; part = part->next)
   {
      min.setMin( part->pos [b]- Point3F( 10.f, 10.f, 10.f)[/b]);
      max.setMax( part->pos [b]+ Point3F( 10.f, 10.f, 10.f)[/b]);
   }

But I need to find how to modify the way engine sorts translucent object, because I have few objects like house with larger bounding box which have Translucent front porch and emitter near it.

I think i'll check that in renderTranslucentMgr class.

Any suggestions/comments..