Experimental:Particle POP

From Derivative
Jump to navigation Jump to search

Summary
[edit]

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[edit]

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
PartMass float Particle’s mass
PartDrag float The drag force factor applied to the particle
PartDeath uint Indicates if a particle should be removed from the simulation (optional attribute)

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).

The PartDrag attribute (D) is used to compute a force () acting on the particles in the direction opposite to their motion (V).

The Velocity Damping parameter simply attenuates the velocity (V) over time using a damping factor ().

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

Extending the Particle Simulation[edit]

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 with the optional PartDeath attribute. 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 -

Parameter Color Space parmcolorspace - - Controls how all color parameters on this node are interpreted. The color values as treated as being in the selected color space, and are converted to the Working Color Space before they are used as part of the node's operation. Note that this does not change the color space of the node itself, as that is always in the Working Color Space.
  • sRGB srgb - sRGB color space, with sRGB transfer function. Considered an SDR color space with respect to Reference White.


  • sRGB - Linear srgblinear - sRGB color space, with linear transfer function. Considered an SDR color space with respect to Reference White.


  • Rec.601 (NTSC) rec601ntsc - Rec.601 with NTSC primaries color space, with Rec.601 transfer function. Considered an SDR color space with respect to Reference White.


  • Rec.709 rec709 - Rec.709 color space, with Rec.709 (same as Rec.2020) transfer function. Considered an SDR color space with respect to Reference White.


  • Rec.2020 rec2020 - Rec.2020 color space, with Rec.2020 (same as Rec.709) transfer function. Considered an HDR color space with respect to Reference White.


  • DCI-P3 dcip3 - DCI-P3 color space, with D65 white point and 2.6 gamma transfer function. Considered an HDR color space with respect to Reference White.


  • DCI-P3 (D60) dcip3d60 - DCI-P3 "D60 sim" color space, with D60 white point, and 2.6 gamma transfer function. Considered an HDR color space with respect to Reference White.


  • Display-P3 (D65) displayp3d65 - Display-P3 color space, with D65 white point, and sRGB gamma transfer function. Considered an HDR color space with respect to Reference White.


  • ACES2065-1 aces2065-1 - ACES 2065-1 (also known as ACES AP0) color space, with a linear gamma transfer function. Considered an HDR color space with respect to Reference White.


  • ACEScg acescg - ACEScg (also known as ACES AP1) color space, with a linear gamma transfer function. Considered an HDR color space with respect to Reference White.


  • Passthrough passthrough - When selected, the color values will be used as-is in the operation, without any modification or attempt to convert them into the Working Color Space.

Parameter Reference White parmreferencewhite - - When converting a parameter color value to the Working Color Space, this controls how it should be treated with respect to Reference White. If the Working Color Space is the same Reference White, then no adjustment is done. If they are different, then the Reference White level (brightness) of this color will be adjusted to the range expected by the Working Color Space. For example if the project is set to have a SDR Reference White of 120 nits, and the HDR Reference White is 80 nits, then a color of (1, 1, 1), which is 120 nits in the SDR color space, will be converted to be (1.5, 1.5, 1.5), which is 120 nits still in the HDR Working Color Space.
  • Default For Color Space default - Will use either the SDR or the HDR Reference White, based on the color space selected.


  • Standard (SDR) sdr - Will treat the Parameter Color Space as SDR for it's reference white value.


  • High (HDR) hdr - Will treat the Parameter Color Space as HDR for it's reference white value.

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:

POPs
Experimental:Accumulate • Experimental:Analyze • Experimental:Attribute Combine • Experimental:Attribute Convert • Experimental:Attribute • Experimental:Blend • Experimental:Box • Experimental:Cache Blend • Experimental:Cache • Experimental:Cache Select • Experimental:CHOP to • Experimental:Circle • Experimental:Convert • Experimental:Copy • Experimental:CPlusPlus • Experimental:Curve • Experimental:DAT to • Experimental:Delete • Experimental:Dimension • Experimental:DMX Fixture • Experimental:DMX Out • Experimental:Extrude • Experimental:Facet • Experimental:Feedback • Experimental:Field • Experimental:File In • Experimental:Force • Experimental:GLSL Advanced • Experimental:GLSL Copy • Experimental:GLSL Create • Experimental:GLSL • Experimental:GLSL Select • Experimental:Grid • Experimental:Group • Experimental:Histogram • Experimental:Import Select • Experimental:In • Experimental:Limit • Experimental:Line Break • Experimental:Line Divide • Experimental:Line Metrics • Experimental:Line • Experimental:Line Smooth • Experimental:Line Thick • Experimental:Lookup Attribute • Experimental:Lookup Channel • Experimental:Lookup Texture • Experimental:Math Combine • Experimental:Math Mix • Experimental:Math • Experimental:Merge • Experimental:Neighbor • Experimental:Noise • Experimental:Normal • Experimental:Normalize • Experimental:Null • Experimental:OAK Select • Experimental:Out • Experimental:Particle • Experimental:Pattern • Experimental:Phaser • Experimental:Point File In • Experimental:Point Generator • Experimental:Point • Experimental:Points, Vertices and Primitives in s • Experimental:Polygonize • Experimental:Primitive • Experimental:Projection • Experimental:Proximity • Experimental:Quantize • Experimental:Random • Experimental:Ray • Experimental:Rectangle • Experimental:ReRange • Experimental:Revolve • Experimental:Select • Experimental:Skin Deform • Experimental:Skin • Experimental:SOP to • Experimental:Sort • Experimental:Sphere • Experimental:Sprinkle • Experimental:Subdivide • Experimental:Switch • Experimental:Texture Map • Experimental:TOP to • Experimental:Topology • Experimental:Torus • Experimental:Trail • Experimental:Transform • Experimental:Trig • Experimental:Tube • Experimental:Twist