• Skip to site navigation
  • Skip to blog entries
  • Skip to archive page
  • Skip to left sidebar
  • Skip to right sidebar

Particle Effects Rendering: Adding Jitter to Particles

Fork Particle Blog

Tuesday, October 23. 2012

Particle Effects Rendering: Adding Jitter to Particles

Posted by
Noor Khawaja
in Particle Effects
Particle jitter is a little nifty feature that comes in handy when you need to add sense of random motion to particles. Jitter motion is the jumpy but slight displacement in the particle’s position; however the original trajectory or the particle dynamics is not altered. So a good place to put in the particle jitter displacement is at rendering stage where this displacement value is not written back into the particle position. Here is (pseudo) code snippet to perform the jitter displacement:


pPos = pointer to copy of particle world position
VRight = right vector of the particle geometry quad
VUp = up vector of the particle geometry quad
fJitter = 1.0f; // Jitter distance
VECTOR3 JitterVector;
int nDirection = rand() % 4;
Vec3Set(&JitterVector, &((VECTOR3)(nDirection < 2 ? ((nDirection == 0) ? VRight : -VRight) : ((nDirection == 2) ? VUp : -VUp))));
Vec3Normalize(&JitterVector, &JitterVector);
Vec3Scale(&JitterVector, &JitterVector, fJitter);
Vec3Add((VECTOR3*)pPos, (VECTOR3*)pPos, &JitterVector);
Trackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as (Linear | Threaded)
No comments
The author does not allow comments to this entry

Links

  • Blog Home
  • Main Website

Archives

  • May 2013
  • April 2013
  • March 2013
  • Recent...
  • Older...

Copyright 2011 Fork Particle, Inc. All Rights Reserved. All trademarks are the property of their rightful owners.

Based on the s9y Bulletproof template framework
Powered by s9y – Template by Bulletproof development team.