Particle System 2D

From RealMotion Wiki

Simulation/Particle System 2D

Instantiates a 2D particles system. ​

Description

The box Particles System 2D allows interaction with a two-dimensional generative particle system. The main interaction mechanism uses the Gradient Input texture allowing collisions with a shape defined within the Foreground Texture. Other behaviors can also be driven by the Gradient texture such as particles spawning, scaling and rotation. An extensive set of parameters customize the inner details of the system. These settings have been categorized in the following tabs: Spawn Mode, Behaviors, Physics, Rendering and Format.

- Spawn Mode: Affects the particles emission cycle. Initial Position, Spawn Mode, Particle Lifetime (Emission Spawn Mode) and Reset of the system may be set in this tab.

- Physics: Affects the Physics Laws of the World in which the particles evolve. Particles Count and Size, Gravity, Looping Direction, Collision Shape and Collisions physical behavior may be set in this tab. Because the parameters within this tab define the Physical World, they may completely change the behavior of the particles.

- Behavior: Affects the way particles react upon a collision. React Factor, Velocity, Rotation and Resize may be set in this tab.

- Material: Manages the way particles are rendered after the simulation. Texture Scale and Flip Book parameters may be set in this tab. Flip Book is a particle texture database allowing particles to dynamically and independently change their texture.

- Format: Sets the format of the Particles system texture and the blending factor used to render the particles.

General Use Case: The particles System 2D box is a powerful and versatile tool to create highly customizable generative content. Falling leaves, snow, confetti explosion are of typical usage. Use in conjunction with other simulation boxes to create water lily, fire with burning brand or paint splatters. Multiple Templates include a Particle System, allowing you to explore the effect of the various parameters.

Inputs

Background 2D Texture Receives the background texture. The background texture sets the format and resolution of the simulation.
Flip Book Loop Tiles Int Vector Set the last valid frame in the Flip Book for each texture of the vector received by the Foreground input pin.
Foreground 2D Texture, Texture FlipBook, Texture Vector Receives the texture of the particles. When the Flipbook is enabled, the flipbook divides the Foreground texture and uses the division as tiles for the texture of the particles. When the FlipBook Vector is enabled, the Foreground receives an vector of texture and divide each texture into tiles.
Gradient 2D Texture Receives the detection texture in a gradient format. The Texture format must be in the RGBA 16 bits to allow negative vector calculation. The alpha determines the location of particle emission.
Max Spawn Trials Int Sets the maximal trials made by frame to successfully create particles until the Spawn Rate Per Frame reach.
Reset Trigger Resets the particle system upon reception of an event.
Spawn Per Frame Float Sets the number of particles spawned per second.

Outputs

Collision Count Int Outputs the current count of Gradient and Environment Collisions.
Particles Float2 Vector Outputs a vector of the position of the living particles.
Texture 2D Render Target Outputs the simulation result in a texture.

Parameters

Spawn Mode

Reset

Enable Input Pin: Reset Toggle Enables the Reset Input Pin.

Spawn Initialization

Initial Position Enable Toggle Enables the spawn of all particles into a determined box on reset.
Uniform Distribution Toggle Enables the uniform distribution of the particles at initialization.
Initial Position Float2 Sets the center of the initial position box.
Initial Position Range Float2 Sets the size of the initial position box.

Spawn Mode

Spawn Mode String Sets the spawm mode. By default, the particles spawn on project launch. For the flow mode, the particles spawn on the active region of the detection texture alpha until the particle count is reached. For the Emission mode, the Particles spawn on the active region of the detection texture alpha until the particle count is reached. The particles have a lifetime to allow renegeration.

Flow

Spawn Rate Per Frame Int Sets the amount of created particles at each frame.
Maximum Spawn Trials Int Sets the maximal trials made by frame to successfully create particles until the Spawn Rate Per Frame reach. Setting the Maximum Spawn Trials lower than the Spawn Rate Per Frame reduces the number of particles created each frame.
Time Between Flows Float Sets the time, in seconds, between the reach of the maximal number of particles and the killing of all particles to reset the flow.

Emission

Particle Lifetime Time Sets the lifetime of each particle.
Particle Lifetime Random Percentage Float Sets the maximal random time added or subtracted to the lifetime of each particle. The value is a percentage of the Particle Lifetime.
Enable Input Pin: Spawn Rate Toggle Activates the input pin Spawn Rate and overrides the Spawn Rate Per Second parameter.
Spawn Rate Per Second Float Sets the number of particles spawned per second.
Enable Input Pin: Max Spawn Trials Toggle Activates the input pin Max Spawn Trials and overrides the Maximum Spawn Trials parameter.
Maximum Spawn Trials Int Sets the maximal trials made by frame to successfully create particles until the Spawn Rate Per Frame reach. Setting the Maximum Spawn Trials lower than the Spawn Rate Per Frame reduces the number of particles created each frame.
Spawn Rotation Enable Toggle Enables initial rotation angle of the particles.
Spawn Rotation Range Float2 Sets the rotation range within the particle are spawning.
Fade In Duration Time Sets the alpha fade in time upon particle birth.
Fade Out Duration Time Sets the alpha fade out time before particle death.

Physics

General

Particle Count Int Sets the maximal particle count. Simulation must restart to see changes made.
Particle Size Float Sets the body size and the visual size of the particles. A value of 1.0 equals the simulation height. Simulation must restart to see changes made.
Particle Size Random Percentage Float Sets the maximal random variation added on each particle. The value is the percentage of the Particle Size. Simulation must restart to see changes made.

World

Margins Float4 Sets the margin (Top, Bottom, Left, Right) outside the screen before the particles collide with the simulation border. This value is multiplied by the gravity internally.
Gravity Float2 Sets the gravity, on the X and Y axis.
Looping Direction String Chooses the looping options for the offscreen particles. None mode contains particles in the screen space. Vertical, Horizontal and Full mode loop particles in the same state. Spawn mode respawn particles in the opposite direction. Infinity mode has no looping border. In any looping case, it is recommended to have margins greater than the Particle Size.

Collisions Particle-Gradient

Gradient Sampling Points Int Sets the number of collision points of the collision shape. A value of 1 result in a point at the particle center and improve the performance.
Gradient Collision Threshold Float Sets the threshold before a collision between a collision point and the Gradient texture is counted. Only active when the Collision Count is enabled.

Collisions Particle-Particle

Particle Collision Enable Toggle Enables the collision between particles.
Collision Elasticity Float Sets the elasticity of a collision.
Collision Damping Float Sets the damping affecting the collision. The damping is the amount of energy lost in a collision.
Environment Collision Threshold Float Sets the threshold before a collision between collision points of particles is counted. Only active when the Collision Count is enabled.

External

Enable Output Pin: Collision Count Toggle Enables the Collision Count Output Pin.

Behavior

Velocity

React Factor Float Sets the React Factor of particles toward the gradient texture. Negative React Factor results in attraction and positive React Factor results in repulsion.
Speed Multiplier Float Sets the speed multiplier of the React Factor. The Speed Multiplier must be between 0.0 and 1.0 to ensure valid particle reaction.
Maximum Velocity Float Sets the maximal velocity reachable by a particle.

Rotation

Rotation Input String Sets the rotation input mode. Physics uses gradient Red and Green components to set the angle of the particles. Gradient B. uses the Blue component to set the speed of rotation of the particles. Velocity Aligned used the particles speed and direction to set the particle angle.
Rotation Multiplier Float Multiplies with the Rotation Input.
Rotation Damping Float Sets the value subtracted to the rotation speed at each frame.
Rotate Speed Minimum Float Sets the minimal speed of rotation.
Rotate Speed Maximum Float Sets the maximal speed of rotation.

Resize

Enable Resize Toggle Enables the resizing of particles upon interaction. The resizing function multiplies with the particle size.
Resize Maximum Float Sets the maximum multiplier of the particles size.
Resize Minimum Float Sets the minimal multiplier of the particle size.
Resize Speed Float Sets the resizing speed.
Resize Exponent Float Sets an exponential resizing speed.
Resize Sensitivity Float Sets the minimal value needed to resize the particles.

Material

Texture Zoom Scale

Zoom In Texture Float Sets the centered rescaling of the particle texture. Note that the value must be set to 1.0 when using the Flip Book mode.
Particle Texture Scale Float Sets the size of the particle texture. Note that this value does not affect the particle size. The Particle Scale only affects the render of the particles.

Flip Book

Enable Flip Book Toggle Enables the Flip Book mode. When using the Flip Book mode, a Flip Book texture must be inputted in the Foreground texture.
Enable Flip Book Vector Toggle Enables the Flip Book Vector mode and allows multiple Flip Book to be assigned to the same particle system. The Foreground texture receives a texture vector and the resolution is supplied with the Flip Book Vector Resolution.
Vector Resolution Int2 Sets the numbers of divisions of each texture in the texture vector. Every texture in the vector is assumed to have this resolution.
Uniform Distribution Toggle Enables the uniform distribution of the Flip Book tiles.
Start Random Offset Int Sets the random offset for the selected Flip Book tile on start
Frequency Float Sets the tile change frequency. Setting the parameter to 0.0 deactivates the tile change.
Frequency Random Amount Float Sets the maximal and minimal random value multiplied by the Flip Book Frequency.
Fade Exponent Float Sets the fading time for every tile change.
Gradient Tiles Change Toggle Uses the gradient texture as a trigger for the Flip Book tile change.
Deactivate Flip Book Loop Toggle Deactivates the Flip Book tile looping.
Enable Manual Looping Tile Toggle Enables setting a specific tile as last tiles before looping in the Flip Book tiles. The mode allows perfect looping of Flip Books that are not completely filled. When the Flip Book Vector mode is active, the Flipbook Loop Tiles input pin receives a int vector to match the received texture vector.
Flip Book Loop Tile Int Set the last valid frame in the Flip Book. Active only when the Flip Book Vector mode is not active.

Shader

Alpha Threshold Float Sets the minimal alpha value of the particles to be drawn on the alpha channel.

External

Enable Output Pin: Particles Toggle Activates the output pin Particles.

Format

Format

|}

Channel Settings
Format String Sets the format of the outputted texture. RGBA 8 bits is the common format. RGBA 16 bits allows negative vector calculation and is mostly used for simulation. RGBA 32 bits allows high precision but may negatively affect the FPS and the Grayscale has only the Red component.
Format Components String Sets the Components used for the outputted texture.
Format Component Bit Depth String Sets the Bit Depth of the outputted texture. 8 bits is the common format, 16 bits allow negative vector calculation and is mostly used for simulation, 32 bits allow high precision but may negatively affect the FPS.
Format Component Type String Sets the pixels value type depending on the Bit Depth.
Use Additive Blending Toggle Uses the additive blending to blend the Foreground texture on the Background texture. When disabled, the blend is made with the alpha of the foreground texture.
Alpha blend type String Uses the additive blending to blend the Foreground texture on the Background texture. When disabled, the blend is made with the alpha of the foreground texture.
Use Background Toggle Uses the Background texture as background texture. When disabled, the buffer of the background is black.

See Also

Boxes related

Gradient, Add Alpha, Massive Particles, Particle System 3D, ​​

Version Information

Current documentation version: 2.1.5. ​ ​