Skip to main content

vScriptValPointParticles

Simulate a small particle system and output the current particle positions, with emission shapes and force controls.

AdvancedMograph / ScriptValScriptValArrayJSON
vScriptValPointParticles node

vScriptValPointParticles has no input and outputs an array of XYZ points, one for each particle at the current time. Emission Type picks the start layout, and the movement, force and flocking controls drive the particles as the frames advance.

Parameters​

ParameterTypeDefaultDescription
Restart SystemFloat—Button that restarts the particle system.
TimeFloat0Multiplier on the frame time that gives the simulation time. 0 stops time, default 0.
Start TimeFloat0Simulation time at or before which the system is rebuilt. Minimum 0, default 0.
Particles CountInteger24Number of particles. Minimum 0, default 24.
Global ScaleFloat1Multiplier applied to the output positions. Default 1.
+39 more parameters
ParameterTypeDefaultDescription
Emission TypeDropdownFibonacci SphereLayout of the start positions, Random, Noise Field, Fibonacci Sphere, Fibonacci Spiral or Fibonacci Disc. Default Fibonacci Sphere.
Size XFloat1Size of the emission box in X, and scale of the Fibonacci layouts in X. Default 1.
Size YFloat1Size of the emission box in Y, and scale of the Fibonacci layouts in Y. Default 1.
Size ZFloat1Size of the emission box in Z, and scale of the Fibonacci layouts in Z. Default 1.
Center XInteger0Has no effect. The emission box is always centered in X. Default off.
Center YInteger0Has no effect. The emission box is always centered in Y. Default off.
Center ZInteger0Has no effect. The emission box is always centered in Z. Default off.
Noise ScaleFloat0.1Scale of the noise field used by Noise Field emission. Default 0.1.
Noise StrengthFloat0.5Size of the noise shift applied to Noise Field positions. Default 0.5.
Noise SeedInteger42Seed of the noise for Noise Field emission and turbulence. Default 42.
Fibonacci RadiusFloat0.3Radius of the Fibonacci layouts. Default 0.3.
Fibonacci HeightFloat2Height of the Fibonacci Spiral. Default 2.
Movement XFloat0.1Largest random start speed in X, in both directions. Default 0.1.
Movement YFloat0.1Largest random start speed in Y, in both directions. Default 0.1.
Movement ZFloat0.1Largest random start speed in Z, in both directions. Default 0.1.
Enable GravityInteger1Hidden control. Has no effect, gravity is always on. Default on.
Gravity StrengthFloat0Force added along Y. Positive values push up. Default 0.
Enable WindInteger1Hidden control. Has no effect, wind is always on. Default on.
Wind XFloat0Wind force along X. Default 0.
Wind YFloat0Wind force along Y. Default 0.
Wind ZFloat0Wind force along Z. Default 0.
Enable TurbulenceInteger1Hidden control. Has no effect, turbulence is always on. Default on.
Turbulence StrengthFloat0.2Strength of the noise force. Default 0.2.
Enable AttractorInteger1Hidden control. Has no effect, the attractor is always on. Default on.
Attractor XFloat0X position of the attractor. Default 0.
Attractor YFloat0Y position of the attractor. Default 0.
Attractor ZFloat0Z position of the attractor. Default 0.
Attractor StrengthFloat0.0Strength of the pull. Negative values push away. Default 0.
Attractor FalloffFloat1Exponent of the distance in the attractor force. Default 1.
Enable FlockingInteger1Hidden control. Has no effect, flocking is always on. Default on.
Separation RadiusFloat0.5Distance within which neighbors push a particle away. Default 0.5.
Separation StrengthFloat0.3Strength of the push away from neighbors. Default 0.3.
Alignment RadiusFloat1Distance within which a particle matches the velocity of neighbors. Default 1.
Alignment StrengthFloat0.1Strength of the velocity matching. Default 0.1.
Cohesion RadiusFloat1Distance within which a particle moves toward the center of its neighbors. Default 1.
Cohesion StrengthFloat0.1Strength of the pull toward the center of the neighbors. Default 0.1.
LifetimeFloat2Longest lifetime of a particle, in simulation time. Minimum 0, default 2.
Lifetime MinimumFloat1Shortest lifetime of a particle. It is limited to Lifetime. Minimum 0, default 1.
Flocking OptimizationInteger1Has no effect. Flocking is always spread over a third of the particles per frame. Default on.
Read the full description

The simulation time is the frame time multiplied by Time. The default for Time is 0, so the time does not advance and the particles stay at their emission positions. Set Time to a value above 0, for example 1, to run the simulation. The system is built again whenever the time is at or before Start Time, when Particles Count changes, and when Restart System is pressed. The state lives in the node, so the result depends on frames being rendered in order.

Emission Type sets where each particle starts. Random picks a random position inside a box of Size X, Y and Z centered on the origin. Noise Field picks random positions in the same box and keeps each one with a probability from layered noise, up to 21 tries, then shifts it by noise multiplied by Noise Strength. The three Fibonacci types place particles by index with the golden angle. Fibonacci Sphere uses Fibonacci Radius and the Size values. Fibonacci Spiral is a disc whose radius grows with the index and which rises over Fibonacci Height. Fibonacci Disc is the same disc at Y = 0. Each particle also gets a random start velocity between minus and plus the Movement value on each axis.

Each step adds forces to the velocity and then moves the particle. Gravity Strength is added to the Y force, so a positive value pushes up. Wind X, Y and Z add a constant force. Turbulence adds a noise force that depends on the particle X, Y and the time. The attractor pulls toward its position with a force of Attractor Strength divided by distance to the power Attractor Falloff. Separation, Alignment and Cohesion add flocking forces among all particles within their radii, and the speed is limited to 2 units per second after flocking.

Every particle has a random lifetime between Lifetime Minimum and Lifetime. When it ends, the particle is emitted again at the current time. All positions are multiplied by Global Scale before output. The Enable checkboxes for gravity, wind, turbulence, attractor and flocking are hidden and have no effect, because the code treats any value as on. The Center X, Y and Z and Flocking Optimization checkboxes are also treated as always on. Flocking therefore updates a third of the particles per frame, and positions are always centered.

Example Connections​

vScriptValPointParticles.Output -> vScriptValCameraProjection.ArrayA
vScriptValCameraProjection.Output -> vScriptValShapeRender.ArrayPoint
Background.Output -> vScriptValShapeRender.Input