How to fix point jitter after random delete in a sim

   614   4   1
User Avatar
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?)

Attachments:
Example.hiplc (294.4 KB)

User Avatar
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:

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
User Avatar
Member
3 posts
Joined: 5月 2019
Offline
Thank you for jumping on this issue!
But that doesn't solve the problem unfortunately. Your solution deletes same points in each copy so it does not break the repetitiveness. I've used point VOP with the noise but points jitter even more.
User Avatar
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]


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
User Avatar
Member
3 posts
Joined: 5月 2019
Offline
Perfect! Thank you so much!
  • Quick Links