Horde3D
http://horde3d.org/forums/

Particles attached to fast moving objects [Solved]
http://horde3d.org/forums/viewtopic.php?f=3&t=1126
Page 1 of 1

Author:  Codepoet [ 16.03.2010, 01:12 ]
Post subject:  Particles attached to fast moving objects [Solved]

Version: community svn trunk, Linux

I want to use the particle system for the exhaust flames of a space ship, but when the FPS is low (30) and the object is moving fast it looks ugly.

Low FPS (limited to 30):
object standing still: looks fine
object moving fast: particles are emitted in "blocks", not evenly spread over time.

High FPS (unlimited, varying between 300 to 400):
object moving fast: looks mostly fine. I'd like to have this behavior also in the low FPS case.

See attached files.

Possible fix with visual result in next post due to file limit.


As a side note: _emissionAccum seems not to be limited and is increased indefinitely, could cause problems after running for a long time.

Attachments:
File comment: moving, high FPS
moving-high_fps.png
moving-high_fps.png [ 199.45 KiB | Viewed 9364 times ]
File comment: moving, low FPS
moving-low_fps.png
moving-low_fps.png [ 173.98 KiB | Viewed 9364 times ]
File comment: standing still, low FPS
not_moving-low_fps.png
not_moving-low_fps.png [ 173 KiB | Viewed 9364 times ]

Author:  Codepoet [ 16.03.2010, 01:18 ]
Post subject:  Re: Particles attached fast moving objects

Possible fix and visual result for FPS=30 is attached. If the patch is accepted I'll commit it to the community svn.

The visual result is only good if the FPS is nearly constant. Another solution (but more CPU intensive) would be to move the code from onPostUpdate to advanceEmitterTime and incrementing the time in small steps.

Attachments:
File comment: patch
diff.patch [2.83 KiB]
Downloaded 714 times
File comment: moving fast, low FPS, patched
fixed-moving-low_fps.png
fixed-moving-low_fps.png [ 155.94 KiB | Viewed 9362 times ]

Author:  marciano [ 16.03.2010, 03:24 ]
Post subject:  Re: Particles attached to fast moving objects

Thanks for your contribution. The main problem I see at the moment is that it might be a bit too specific to your exact problem with the hard-coded constants.

However, when reading through some of the GDC presentations, I stumbled across this: http://drewskillman.com/GDC2010_VFX.pdf
Check page 76, the idea seems to be similar to what your are doing now but more generalized. This would be nice to have in Horde (and a few of the other particle features as well ;)).

Author:  Codepoet [ 16.03.2010, 20:16 ]
Post subject:  Re: Particles attached to fast moving objects

I've included your suggestions in the attached patch.
  • Still distributing particles evenly over space
  • Removed magic constant
  • Do not update particles in the time step in which they were created. Particles first show at the origin of the emitter.
  • Added support for configurable drag. If drag is positive, particles are moving in the same direction as the object. Drag assumes, that an object is moved in a smooth fashion without jumps.

Not in Patch: new constant for bindings (old constants still work)

Attachments:
File comment: knight sample with patch applied
knight.png
knight.png [ 164.18 KiB | Viewed 9342 times ]
File comment: Patch v2
diff2.patch [7.35 KiB]
Downloaded 716 times
File comment: moving fast, 30 fps
patch2_low_fps.png
patch2_low_fps.png [ 290.96 KiB | Viewed 9342 times ]

Author:  marciano [ 17.03.2010, 01:45 ]
Post subject:  Re: Particles attached to fast moving objects

Great work, thank you very much! :)

Volker will soon integrate a slightly adapted version of your patch. Please let us know if there are any problems with it.

Author:  Volker [ 17.03.2010, 02:14 ]
Post subject:  Re: Particles attached to fast moving objects

It's in, thanks again Codepoet for your great work.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/