How to fix point jitter after random delete in a sim
614 4 1- Sevas
- Member
- 3 posts
- Joined: 5月 2019
- Offline
Hi there! Does anyone know how to fix point jitter after randomly deleting particles? I've attached a simple example. Basically I have a pop sim then I copied it to points and to avoid repetition I dropped down a wrangle and deleted particles randomly. Now they jump around. I found a solution when you scatter points and then use attribute interpolate but that does not work in this case.(Or maybe it does?)
- animatrix_
- Member
- 4521 posts
- Joined: 2月 2012
- Offline
Hi,
Particles already have unique id values, you are overwriting them using point numbers which are changing after deleting points. Just use the id attribute directly:
Particles already have unique id values, you are overwriting them using point numbers which are changing after deleting points. Just use the id attribute directly:
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- Sevas
- Member
- 3 posts
- Joined: 5月 2019
- Offline
- animatrix_
- Member
- 4521 posts
- Joined: 2月 2012
- Offline
Then you can create a new unique id on the template points and copy those onto the copied points i.e. ptid. Combine both id values into a single integer using Szudzik pairing:
http://szudzik.com/ElegantPairing.pdf [szudzik.com]
http://szudzik.com/ElegantPairing.pdf [szudzik.com]
int szudzik ( int x; int y ) { return x >= y ? x * x + x + y : y * y + x; } int tmId = szudzik ( @id, i@ptid ); float tmVal=rand(tmId + ch("Seed")); if (tmVal > ch("Threshold")) removepoint(geoself(), @ptnum);
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- Sevas
- Member
- 3 posts
- Joined: 5月 2019
- Offline
-
- Quick Links