Particles POP - Calculate velocity with cache gives weird results

Hey everyone. I’m having so much fun playing with the new POP family. Seriously this is truly amazing! Great work!

I’m facing a weird problem. I set a up a quick basic example to let you see the problem:
POP_particles_velocity.toe (11.4 KB)

Basically I’m moving particles with noise instead of forces, so the partVel attribute is not filled up by the particle system. So to be able to orient the particles along velocity, I’m calculating velocity using a basic cache POP, substracting P with P from previous frame.

Everything works great and as expected, but after a few seconds, the rotation goes crazy. In the file you can see that I’m monitoring the P value inside a trail CHOP. When you reset the system (keyboard 1 then 2), you can see that the P value in the trail is smooth as expected. Then after a few seconds, the value start acting crazy.

I was suspecting the partID to cause this, but the problem is here even when the particle ID is set to “don’t reuse”, and the Trail POP is working just fine (it’s using partID right?)

So what am I missing? Any idea?
Is this a bug or just me misunderstanding something?

Thanks in advance!

Hello @kefon
The issue you’re encountering stems from how particle information shifts within the attribute buffers. When particles die, they’re removed from the position buffer, and remaining live particles fill their spots. As a result, comparing the current position buffer with the one from the previous frame leads to a mismatch—you’re effectively mixing data from different particles, which results in incorrect velocity values.
A reliable way to track particles across frames is to use the Trail POP with the Match by Attribute parameter enabled and set to the Attribute Name to PartId . This creates line strips that can be fed into a Line Metric POP to compute velocities. Additionally, the Particle POP should have Don’t Reuse Point IDs enabled to prevent trails from being merged or confused across particles.

I’ve modified your example to demonstrate how this can be done.

POP_particles_velocity_from_trail.toe (10.8 KB)

Also an alternative would be to apply the noise to the PartVel attribute as opposed to the position directly. This allows you to use the PartVel attribute as the rotation vector

partvelnoise.toe (11.3 KB)

I knew something was off in my thinking…
Thanks a lot @Guillaume.L and @davispolito for your feedbacks and answers!
Both ways work like a charm and have their own benefits and use cases.
Thanks a lot for your help! :ok_hand: