[osg-users] osgParticle behavior with discontinuous and reversed time

Robert Osfield robert.osfield at gmail.com
Mon Jan 16 00:00:43 PST 2017


Hi Rob,

osgParticle was never design to handle your usage case so it's not
surprising that you are struggling to make it work for you.
osgParticle for the most part is an old CPU based design, we maintain
it mainly for backwards compatibility.

If I were to implement a particle system for a simulator these days
I'd write it with shaders.  Shaders offer so much flexibility and
performance that doing so is generally pretty quick and easy to do.
This is what I recommend you to do - work out what effects you need
with your particles and implement it in shaders.  Using a custom
approach like this would allow you to make sure it works properly when
you are jumping around in time.

Robert



On 15 January 2017 at 02:39, Robert Spearman <rob at digitaliseducation.com> wrote:
>
> I have a simulator where time can go forward or backward and I am
> integrating an osgParticle system which draws line particles.  My particle
> lifetimes are under 1 second.
>
> I am looking for suggestions on the following problems:
>
> When I jump ahead in simulation time (by a week, for example) the currently
> live particles stick around for that week plus their remaining lifetimes.  I
> would expect them to die immediately because the delta time that just
> elapsed is much greater than their lifetimes.
>
> When I jump backwards a similar issue occurs.  But as I jump back in time
> before the simulation time when the particle system was initialized, the
> start and end of the particle lines seem to grow apart until I have
> enormously long particles (presumably from the parent node moving with
> time).  Only going past the start time again resolves the issue.  I would
> expect particles to work normally at any time in my simulation as long as
> time is going forward.
>
> When time is in reverse weird things happen as well, but less severe.  I
> would be fine if nothing drew while time is reversed since obviously there
> is no way to easily reverse a particle system.
>
> So...  I've tried turning off the particle system node while time is jumping
> but it doesn't resolve anything.  I've tried modifying osgParticle to kill
> the particles when dt is zero (since negative dt is not allowed by the
> particle updater).  I then get no particles at all until time is again after
> the startup time, which is some improvement.  But I don't see what is
> storing the particle system initialization time or why.
>
> Wondering if anyone has any ideas.
>
> Thanks!
> Rob
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list