Hi Maxim, This is a interesting issue - down to a design issue with the crude particular simulation that osgParticle does, ideally one wouldn't have start and stops in the simulation unless that was directed by the simulation itself.
In this particular case, having too many particles all thrown in at one time step clearly is inappropriate, just randomizing this value, like you've done , doesn't seem to be appropriate either, effectively your code is doing is assuming a time interval of 1, but only using this if more than the max number of particles are selected. If one wanted this behaviour a better way of doing it would be to clamp the max dt used in the computation to 1, or to clamp the max number of particles to getRateRange().maximum. Thoughts? Robert. On Thu, Aug 26, 2010 at 8:25 AM, Maxim Gammer <[email protected]> wrote: > The problem with the system of particles: > in hiding the particle system and their subsequent screening creates a huge > number of particles (splash). But more than the big time difference between > concealment and display. The drawings depicted such a situation. > http://i35.tinypic.com/ridkhu.jpg > http://i33.tinypic.com/2nulhfd.jpg > The first figure shows the correct image, the second figure shows the > erroneous operation of the system of particles. > In addition, when a large number of particles occurs following warning: > Warning: State:: drawQuads (0, 72588) too large handle in remapping to > ushort glDrawElements. > Warning: State:: drawQuads (0, 72592) too large handle in remapping to > ushort glDrawElements. > Warning: State:: drawQuads (0, 72592) too large handle in remapping to > ushort glDrawElements. > Warning: State:: drawQuads (0, 72596) too large handle in remapping to > ushort glDrawElements. > fix this problem : > > inline int RandomRateCounter::numParticlesToCreate(double dt) const > { > _np += dt * getRateRange().get_random(); > int n = static_cast<int>(_np); > _np -= n; > if (n > getRateRange().maximum) > { > n = getRateRange().get_random(); //or .get_random > _np=0; > } > return n; > } > > in attached file.... > > -- > Maxim Gammer > > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
