Continue to increment point numbers after particles die

   4523   10   1
User Avatar
Member
29 posts
Joined: Aug. 2014
Offline
Hello! I've followed this tutorial [youtube.com] to create a particle simulation with instanced geometry using a copy sop. This is working well up until particles start to die. When a particle dies its point number is released and reused by another particle - causing most of the particles in the simulation to be reassigned a new number - which in turn causes some crazy jittering.

A little more detail in case my first part doesn't make sense: Each particle has the same lifespan, so my point number range is constantly 1-94. Currently, when the first particle dies, the next particle born is point number 94. Is there a way to allow the point numbers to increment continuously on the particle simulation? So when the first particle dies, the next particle born will be point number 95, then 96, 97, etc… Thanks!
Edited by borbs727 - March 1, 2017 11:56:08
User Avatar
Member
8 posts
Joined: Jan. 2016
Offline
So what you might be looking for is point ID. These aren't re-used in a particle sim. If you set the ID of the copied geo to that of the particles (you can do this on the copy sop) and change motion blur of the object to Geometry Velocity Blur this should sort you out.

The motion blur is set in the Sampling tab of the Rendering tab of the geo node you are working in.
User Avatar
Member
29 posts
Joined: Aug. 2014
Offline
Hi Alex,

Thanks for the info! After doing some digging in the copy sop docs and trying out your suggestion it's still not working. This is my first time really wrapping my head around the copy sop, but I think I'm starting to get the hang of it. I've set “id” to primitive in the copy sop's attribute tab. I can see it's working in the geometry spreadsheet, but the cubes are still changing colors beginning at frame 25. I've attached an example hip.
Edited by borbs727 - March 1, 2017 15:50:30

Attachments:
copy_sop.hiplc (361.3 KB)

User Avatar
Staff
6245 posts
Joined: July 2005
Online
Change the VEXpression in /obj/source_particles/point1 to

rand(@id)
User Avatar
Member
29 posts
Joined: Aug. 2014
Offline
jlait
Change the VEXpression in /obj/source_particles/point1 to

rand(@id)

Hi jlait,

Thanks for the tip! While that does fix the color issue, I just put the color there to illustrate that the geometry was jumping. I want to make sure that the geo is copied to the particles by ID, not point number (I'm not quite sure how to go about doing that).

If you turn on the primitive number visibility you'll see that the geo is following the particles fine until frame 25, then they start to change every frame as the particles start to die.
Edited by borbs727 - March 1, 2017 17:51:45
User Avatar
Member
402 posts
Joined: June 2014
Offline
Could you switch off ‘Reap Particles’ on the POP solver and then use @dead<1 as the template group on the copy SOP? You could always clean up the ‘dead’ particles after this step.

Just a thought, I may have missed something silly…
Henry Dean
User Avatar
Member
8 posts
Joined: Jan. 2016
Offline
As far as I know you can't copy using anything other than the point number. What is it that you want to happen to the geo when the particle dies? Do you want it to die as well or do you want it to hang around?
User Avatar
Member
29 posts
Joined: Aug. 2014
Offline
Worked like a charm, friedasparagus!! Thanks for all the help everyone! Here's the file with the adjustments

Actually, I was fooled! Turning reap off fixes the jitter, but once I start deleting partiles/geo using @dead>1 the physical geo still jumps around to the changing point numbers. The colors remain tied to the ID which made me think the issues was resolved. When I went back and took a look at the prim numbers they started to change once particles were removed.
Edited by borbs727 - March 2, 2017 13:40:50

Attachments:
copy_sop.hiplc (364.5 KB)

User Avatar
Member
29 posts
Joined: Aug. 2014
Offline
Alex Twigg2
As far as I know you can't copy using anything other than the point number. What is it that you want to happen to the geo when the particle dies? Do you want it to die as well or do you want it to hang around?

When the particles die I'd like the copied geo to die with it. I've attached a new example file below that better illustrates the jumping/jitter I've been talking about. I've also attached some visuals too if that helps.


EXAMPLE

I did a small scale test with a burst of 4 particles. Lets say I start off with 3 particles moving through space (see attached image). Each numbered shape corresponds to copied geo. The number is the point number.

The left side is what I'm getting, the right side is what I want to happen.

Notice on frame 3, when particle 0 should be dead, particle 3 is actually the particle that is killed (along with the copied geo on it). The geo copied to particle 0 and should have died, but instead it jumps to the new particle 0.
Edited by borbs727 - March 2, 2017 14:53:06

Attachments:
copy_sop.hiplc (466.0 KB)
copy_sop.jpg (215.9 KB)

User Avatar
Member
918 posts
Joined: March 2014
Offline
I hope I got you right, please have a look at the attached file.

Edit: Also, if you change the Variable1 on your copy1 SOP from:

rand($PT*436) * 999 to rand($ID*436) * 999 it's doing what you want.

Attachment replaced.
Edited by Andy_23 - March 2, 2017 16:13:18

Attachments:
copy_sop.hiplc (491.3 KB)

User Avatar
Member
29 posts
Joined: Aug. 2014
Offline
Andy58
Edit: Also, if you change the Variable1 on your copy1 SOP from:

That was it, Thanks, Andy! I'm still getting the hang of attributes and how to integrate them. Learned a lot on this one
  • Quick Links