[osg-users] Particle Sorting

DC Fennell dchristopher at playnet.com
Thu Sep 6 08:55:43 PDT 2007


Thanks for the examples. I ran your ".osg" files with the OSG multitexture example, which shows a plane with an engine on fire. As you can see from the screen shots, this illustrates the problem. With both the SmokeLowerBin.osg and the SmokeSameBin.osg, the results are the same. Unless there is one particle system which handles/sorts all emitted particles (from the engine fire and from your smoke example), this anomaly occurs.

Here is the top view to show where your system is compared to where the engine fire is:



A side view. Your system particles should be sorted behind the engine fire smoke


This is exactly the problem I run into.


  ----- Original Message ----- 
  From: Zach Deedler 
  To: 'Public OpenSceneGraph Users discussion list.' 
  Sent: Wednesday, September 05, 2007 6:38 PM
  Subject: Re: [osg-users] Particle Sorting


  Try running this:

  Osgviewer SmokeBox.osg.0,90,0.rot SmokeBox.osg

  This doesn't show any anomalies even though the smoke boxes have the same positions.  Maybe because the smoke is faded away?

   

  You can also try

  Osgviewer SmokeBox.osg.0,90,0.rot SmokeBox.osg cessnafire.osg

  Since the smoke box has binnumber 13 it will have priority over the Cessna smoke and fire.

   

  You will still see an anomaly here because the particles are traveling away from their source (which is where they are depth sorted from).  You will see something like this:



  The only way I know around this is to split up the particle system into multiple particle systems, so that their depth sort is more likely to succeed.

   

  -----Original Message-----
  From: osg-users-bounces at lists.openscenegraph.org [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of DC Fennell
  Sent: Wednesday, September 05, 2007 6:46 PM
  To: Public OpenSceneGraph Users discussion list.
  Subject: Re: [osg-users] Particle Sorting

   

  Hello,

   

  The settings you mentioned below have been set. These are set  by default 

  within the osg particle system. The problem still exists when I create 

  another bin.

   

  I wish I could be of help with the polygon sorting, but I have never 

  implemented it with osg.

   

  ----- Original Message ----- 

  From: "Michele Bosi" <michele.bosi at gmail.com>

  To: "Public OpenSceneGraph Users discussion list." 

  <osg-users at lists.openscenegraph.org>

  Sent: Wednesday, September 05, 2007 5:14 PM

  Subject: Re: [osg-users] Particle Sorting

   

   

  > Hi,

  > I am also dealing with transparencies and sorting, in your case maybe

  > it's enough to mask off z-buffer writing for all the particle systems

  > using something like:

  > 

  >  osg::Depth* depth = new osg::Depth();

  >  depth->setWriteMask(false);

  > 

  >  your_geode->getOrCreateStateSet()->setAttribute(depth,

  > osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);

  > 

  > also be sure that all the rest is ok, like

  > your_geode->getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

  > 

  > usually for particle systems using this little trick you don't need to

  > sort at all.

  > The method has some flaws since the result is not really correct as if

  > you sorted your particles but since they are moving this shouldn't be

  > a problem.

  > 

  > Theoretically transparent object that don't write on the z-buffer

  > should be rendered after the transparent ones that do write on it so

  > in order to obtain more correct results for your particles you should

  > create another BIN  (I know you can do it but have no idea how) and

  > schedule it after TRANSPARENT_BIN.

  > 

  > I just posted a question about polygon sorting, have you ever

  > implement it with osg or do you have any particular advice share?

  > 

  > Regards,

  > Mike

  > _______________________________________________

  > osg-users mailing list

  > osg-users at lists.openscenegraph.org

  > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 

   

  _______________________________________________

  osg-users mailing list

  osg-users at lists.openscenegraph.org

  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------------------------------------------------------------------


  _______________________________________________
  osg-users mailing list
  osg-users at lists.openscenegraph.org
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070906/05103dca/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 23549 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070906/05103dca/attachment-0009.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 21280 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070906/05103dca/attachment-0010.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 18638 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070906/05103dca/attachment-0011.jpeg>


More information about the osg-users mailing list