Close

Experimental:Particle POP

Summary

The Particle POP is used for creating and controlling motion of "particles" for particle system simulations. A particle is simply a POP point with special attributes that are created by the Particle POP or added/modified manually by the user in a feedback-type loop, making it easy for customization. POPs are able to handle millions+ of points as they fully run on the GPU.

Particles are created with an initial position (P) and a velocity (PartVel) as well as mass (PartMass) that derive from (1) the input POP's points, (2) Particle POP's parameters and (3) attributes feeding back (see below). Particles can be emitted based on a constant emission rate or can be emitted based on an input attribute. When emitting based on an input attribute, the Particle POP checks the emitting attribute for each input point and emits that many particles at that position every frame (the emission value is converted to an integer).

The particle system is open and highly customizable. It is based on a feedback loop where the output is sent to standard POP nodes and the Force POP nodes that add forces, constrain points, change states to dying/etc, leading to a Null POP at the end of the chain. That Null POP is used by the Particle POP to retrieve the system's state for the next frame (specified by the Feedback parameter). The Particle POP looks for the attributes PartForce and PartVel to compute the positions for the current frame.

The Particle POP is based on the features and behavior of the Feedback POP. To Initialize, Start, end, pause, speed, pre-roll the particle system, it uses the TouchDesigner "Initialize / Start" standard based on the Timer CHOP. It shares several of the same parameters, and if you attach an Info CHOP to the Particle POP, you will see the same state channels and timer channels as the Timer CHOP.

topic: attributes created / determined when the particle is created. Attributes created / modified every loop cycle.

See examples in POP Examples/ and Overview.toe

See Learning about POPs

PythonIcon.pngparticlePOP_Class


Attributes

Particles have various attributes that regular geometry do not have. These attributes must be carried with each point in order to carry out the simulation. These attributes are listed below

Particle Attributes
Attribute Name Type Description
PartId uint A unique id for the particle
P vec3 The particle’s position
PartAge float The particle’s age (in seconds)
PartLifeSpan float The particle’s lifespan (in seconds)
PartForce vec3 The cumulative forces applied to the particle

During simulation, the position is updated based on the applied forces (F), the mass (m), the velocity (V), the position (P) and the delta time (dt).

<math> V_{t+1}=V_{t}+\frac{F}{m}*dt\\ P_{t+1}=P_{t}+V_{t+1}*dt </math>

When the PartDrag attribute is enabled, the new velocity depends on the drag factor (D)

<math> V_{t+1}=V_{t+1} * (1 - D)\Rightarrow D \in [0,1] </math>

Particles can carry additional attributes. These attributes can be copied from the input POP are created with an initial value.

Extending the Particle Simulation

By default, the particle simulation is very basic. The particles positions are updated based on the velocity attribute. Particles that reach their lifespan are removed from the simulation.

To inject forces in the simulation and affect the particles velocities, for example, the particle system has to be extended. A POP node downstream in the network has to be referred. This reference will act as a feedback loop and reinjects the particles updated attributes in the particle simulation. With this mechanism, it’s possible to extend the simulation to control particles forces, spatial limits, collisions, etc.

This extending mechanism has some limitations. The number of particles reinjected in the Particle POP has to be the same. Points can’t be added or removed downstream and reinjected back. The Particle POP is responsible for creating and removing particles, but it’s possible to control birth with input emission attributes and death by forcing the particle age to go beyond its lifespan. Another limitation is that the reinjected points need to carry the particles' reserved attributes.


Parameters - Particles Page

Target Particles Update POP particlesupdatepop -

Create Point Primitives createpointprim -

Point Id Reuse pointidreuse - -
  • Reuse Point Ids in Loop loop -
  • Reuse First Available Point Id unused -
  • Don't Reuse Point Ids none -

Maximum Particles maxparticles -

Emission from emissionmode - -
  • Birth Rate rate -
  • Birth Attribute attr -

Birth Rate birthrate -

Birth Rate Unit birthrateunit - -
  • S seconds -
  • F frames -

Input Birth Attribute birthattr -

Randomize Input Points rndinputpts -

Life Expect life -

Life Expect Unit lifeunit - -
  • S seconds -
  • F frames -

Life Variance lifevariance -

Random Seed randomseed -

Velocity Damping damping -

Initialize initializepulse -

Start startpulse -

Play play -

Speed speed -

Pre-Roll preroll -

Pre-Roll Unit prerollunit - -
  • S seconds -
  • F frames -

Go to Done donepulse -


Parameters - Attributes Page

In Attributes attrs - -
  • * * -

Rename to renameto -

Initial Velocity Attribute initvelattr -

Use Mass Attribute usemassattr -

Initial Mass Attribute initmassattr -

Use Drag Attribute usedragattr -

Initial Drag Attribute initdragattr -

Use Death Attribute usedeathattr -

New Attribute attr -
New Attribute Name attr0name - -
  • Custom custom -
  • N n -
  • Color color -
  • Tex tex -
  • PointScale pointscale -
  • LineWidth linewidth -

Custom Name attr0customname -

New Attribute Type attr0type - -
  • float float -
  • double double -
  • int int -
  • uint uint -
  • dir dir -
  • dbl dir ddir -

New Attribute Number of Components attr0numcomps - -
  • 1 1 -
  • 2 2 -
  • 3 3 -
  • 4 4 -

New Attribute Default Value attr0value - -
  • New Attribute Default Value attr0valuer -
  • New Attribute Default Value attr0valueg -
  • New Attribute Default Value attr0valueb -
  • New Attribute Default Value attr0valuea -


Parameters - Common Page

Bypass bypass -

Delete Input Attributes delinputattrs -


Operator Inputs

  • Input 0: -


Info CHOP Channels

Extra Information for the Particle POP can be accessed via an Info CHOP.

Common POP Info Channels

Common Operator Info Channels

  • total_cooks - Number of times the operator has cooked since the process started.
  • cook_time - Duration of the last cook in milliseconds.
  • cook_frame - Frame number when this operator was last cooked relative to the component timeline.
  • cook_abs_frame - Frame number when this operator was last cooked relative to the absolute time.
  • cook_start_time - Time in milliseconds at which the operator started cooking in the frame it was cooked.
  • cook_end_time - Time in milliseconds at which the operator finished cooking in the frame it was cooked.
  • cooked_this_frame - 1 if operator was cooked this frame.
  • warnings - Number of warnings in this operator if any.
  • errors - Number of errors in this operator if any.


TouchDesigner Build: