Sorry that we are so late to chime in on this thread, but I'd like to post a
response to the content presented here in hopes to help others, and perhaps fix
code as well.
Rick is the original author of the client particle system code we use for our
game. I have passed this thread to him and here is his response:
Rick:
As for the particle system structure, mine is arranged like the last one on
that email you showed me:
Group--+ | +--MatrixTransform 1--+ | |
| +--Geode of main Body
| | | +--Modular Emitter
| +--Geode for particles | +--ParticleSystemUpdater
Except I think he had a typo. The ParticleSystemUpdater, if I understand it
correctly, is a Drawable, so it is actually a child of the Geode. The one that
I have is a ParticleSystem. Perhaps I am wrong and the PartilceSystemUpdater
is something else. Anyway, mine looks like this right now:
Group--+ | +--MatrixTransform 1--+ | |
| +--Geode of main Body | |
| +--ParticleEffect (Modular Emitter?)
| +--Geode for particles--+ |
+--ParticleSystem (ParticleSystemUpdater?)
So perhaps there is something else to look at here. We could also just make
the little fix you found for the time being and be done with it. Perhaps we
should shoot off an email in response and ask the question of the OSG community?
Jolley, Thomas P
Thu, 23 Apr 2009 09:17:36 -0700
Hi Robert,
> -----Original Message-----
> From: Robert Osfield
>
> Hi Tom,
>
> I wouldn't expect the cessnafire.osg model to work under a
> moving MatrixTransform, this is a known attribute of
> osgParticle - you have to move the ParticleSystem outside of
> any moving models, you can't leave it from within the moving
> subgraph otherwise the particles get transformed twice.
This is how it worked before the September change. With the change it sort of
works under a MatrixTransform. The change seems to undo any MatrixTransforms
above the particle system. I don't know enough about what Tim was trying to
correct but it looks almost like "fixing" this attribute of osgParticle.
>
> The osgparticleeffects example illustrates how to handling
> moving models and particle systems.
I'll take a closer look at this example. I'll see if I can come up with some
examples that demonstrate the problem I'm running into.
>
> In your own case I don't know what to make of the issues,
> could it be that you aren't constructing your particle system
> appropriately for moving models, or is it that you have a
> genuine precision issue that is unrelated to the moving model
> issue? Tim's submission was intended to address some of the
> precisions issues, so it's disappointing that in some usage
> case it might have made things worse. Reverting this change
> would break the problem Tim was trying to solve though, so
> I'm very reluctant to do this without clear illustration of
> problems and a solution that addresses both the issues you
> are seeing and the ones that Tim was seeing.
My construction and rearangement of a model like cessnafire.osg worked just
fine before the September change. I had no particle placement or precision
issues precisely because of how I rearanged the model and added additional
MatrixTransforms above the ModularEmitters and Geodes with Particles. I
suppose a picture is worth a thousand words.
Original graph
Group -+
|
+--Geode of main Body
|
+--Modular Emitter
|
+--Geode for particles
|
+--ParticleSystemUpdater
Modified graph
Group--+
|
+--MatrixTransform 1--+
| |
| +--Geode of main Body
|
+--MatrixTransform 2--+
| |
| +--Modular Emitter
|
+--MatrixTransform 3--+
| |
| +--Geode for particles
|
+--ParticleSystemUpdater
With the modified graph I set the model position and attitude with MT1. I set
MT3 to a translation where the model will be used and do not update it. MT2
uses the rotation of MT1 and the translation is set to MT1's translation minus
MT3's translation. This keeps everything well withing single precision values
and avoids the known attibute of osgParticle you described above.
With the September change I need to modify the original model as follows:
Group--+
|
+--MatrixTransform 1--+
| |
| +--Geode of main Body
| |
| +--Modular Emitter
|
+--Geode for particles
|
+--ParticleSystemUpdater
Because the ModularEmitter is now doing a transformation on particles, MT2
would be the same as MT1 from before. MT2 goes away and just put the
ModularEmitter under MT1. Since the ModularEmitter is now creating particles
in world coordinates, MT3 is no longer needed. However, because the
translation in MT1 can be so large for geocentric coordinates, precision is
lost with Particles only being single precision.
I think the bottom line is the ModularEmitter is now doing the work of a
MatrixTransform on particles in single precision.
I agree with you that we need to be careful of reverting the change. I don't
know enough about the problem Tim was trying to overcome to even suggest a
solution that can meet both problems.
>
> Unfortunately not being the original author of osgParticle I
> don't have a 100% clear picture of the internal
> implementation so am effectively in the same boat as everyone
> else - I just have to read the code and try and make sense of it.
>
> Robert.
>
> On Wed, Apr 22, 2009 at 6:35 PM, Jolley, Thomas P
> <[email protected]> wrote:
> > Hi Robert,
> >
> > A little late but I just noticed this change has broken particle
> > effects in my application. When I tried to change my
> application to
> > work with this change I get problems with floating point
> precision on
> > the particles. I don't think this change is the correct
> solution for
> > fixing floating point precision problems with particle
> effects. It's
> > better done at the application level by separating out non-particle
> > system nodes, particle processors, and the geodes where
> particles are placed.
> > An appropriate MatrixTransform can be placed above each new
> graph to
> > resolve the precision issues for the particular frames of reference.
> > Perhaps Tim Moore can explain further the problem he was
> trying solve
> > by giving us an example.
> >
> > Here are some examples of how this change looks like it
> might work and
> > how it doesn't work using the cessnafire.osg model.
> >
> > 1. How it looks like it might work. Load the cessnafire.osg model
> > and put it under a MatrixTransform. Using the
> MatrixTransform, move
> > the model to about 6M meters. Watch the particle effects when the
> > model is slowly translated using the MatrixTransform. The
> precision
> > of the particles look good. The particles are emitted from the
> > correct location from the model. The particles once
> emitted move with
> > the MatrixTransform when they should stay fixed to the world
> > coordinate system.
> >
> > 2. How it doesn't work. Load the cessnafire.osg model and put it
> > under a MatrixTransform. Put the MatrixTransform under a
> Group. Move
> > the Geodes where particles are placed so that they are
> under the top
> > Group node. You may as well move the ParticleSystemUpdater
> under the
> > top Group node. Moving the model out to 6M meters and slowly
> > translate the model using the MatrixTransform. The
> precision of the particles is bad.
> > The particles are emitted from the correct location but
> possibly the
> > wrong direction due to precision problems. The particles
> once emitted
> > stay fixed to the world coordinate system as I would expect.
> >
> >
> > -----Original Message-----
> > From: Robert Osfield [mailto:[email protected]]
> > Sent: Thursday, September 18, 2008 5:12 AM
> > To: OpenSceneGraph Submissions
> > Subject: Re: [osg-submissions] osgParticle ParticleSystem and
> > ModularEmitterin different coordinate systems
> >
> > Thanks Tim, I've merged your changes, and also added a
> > Drawable::getWorldMatrices(const Node*) method and tweaked
> your code
> > to use this rather than needing to use getParents(0) and then
> > getWorldMatrices() as getParents(0) could in theory be null
> (although
> > in a correctly set up scene it won't be).
> >
> > Could you do an svn update and test out my changes, Robert.
> >
> > On Wed, Sep 10, 2008 at 9:39 AM, Tim Moore
> <[email protected]> wrote:
> >> Hello,
> >> This submission fixes a bug when the ModularEmitter and
> >> ParticleSystem
> >
> >> are in different frames of reference. Specifically, it
> supports the
> >> case where the ParticleSystem is not in the world frame.
> One way this
> >> can come up is if your world coordinate system is
> Earth-centric; the
> >> float coordinates of particles don't have enough precision
> to avoid
> >> terrible jitter and other rendering artifacts, so it's
> convenient to
> >> root the particle systems in a local Z-up coordinate
> system that gets
> > moved around from time to time.
> >>
> >> I haven't touched the rotation and angular velocity properties of
> > particles.
> >> IMHO they are pretty broken, dealing in Euler angles and
> such, and I
> >> see that they aren't used in the rest of the particle system code.
> >>
> >> Tim
> >>
> >> _______________________________________________
> >> osg-submissions mailing list
> >> [email protected]
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscen
> >> e
> >> graph.org
> >>
> >>
> > _______________________________________________
> > osg-submissions mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscene
> > gr
> > aph.org
> > _______________________________________________
> > osg-submissions mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscene
> > graph.org
> >
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-o
penscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
a.. [osg-submissions] osgParticle ParticleSystem and ModularEmitter in
different coordinate systems Tim Moore
a.. Re: [osg-submissions] osgParticle ParticleSystem and ModularEmitter in
different coordinate systems Robert Osfield
a.. Re: [osg-submissions] osgParticle ParticleSystem and ModularEmitterin
different coordinate systems Jolley, Thomas P
a.. Re: [osg-submissions] osgParticle ParticleSystem and
ModularEmitterin different coordinate systems GMD GammerMaxyandex.ru
a.. Re: [osg-submissions] osgParticle ParticleSystem
andModularEmitterin different coordinate systems Jolley, Thomas P
b.. Re: [osg-submissions] osgParticle ParticleSystem and
ModularEmitterin different coordinate systems Robert Osfield
a.. Re: [osg-submissions] osgParticle ParticleSystem
andModularEmitterin different coordinate systems Jolley, Thomas P
c.. Re: [osg-submissions] osgParticle ParticleSystem and
ModularEmitterin different coordinate systems Robert Osfield
a.. Re: [osg-submissions] osgParticle ParticleSystem
andModularEmitterin different coordinate systems Jolley, Thomas P
a.. Reply via email to
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org