CParticleSamplerCurve

From PopcornFX
Jump to: navigation, search

Particle sampler curve - Main page : Particle samplers Particle samplers


The curve sampler allows you to sample a custom curve of 1, 2, 3, or 4 dimensions.


Curve editor


Particle sampler curve Node properties

Field name Default value Description
Particle sampler curve General
MinLimits -Infinity Clamps the curve to a minimum value. Useful to avoid getting values below a certain value, usually 0.0.
MaxLimits +Infinity Clamps the curve to a maximum value. Useful for curves that shouldn't go beyond a certain value, for example 1.0
IsProbabilityCurve false When checked, the runtime will treat the curve as a probability function, compute the CDF of the curve and expose the 'sampler CDF' function to scripts.
Particle sampler curve properties


Particle sampler curve Script bindings

for each sampler, depending on the curve's dimension, the following are published to scripts:


Curve Dimension Function
1
float	sample(float cursor);
2
float2	sample(float cursor);
3
float3	sample(float cursor);
4
float4	sample(float cursor);


The 'cursor' parameter should be in the [0,1] curve, and will map the horizontal axis of the curve.
the function will return the value of each component of the curve at that coordinate.


Particle sampler curve Node viewer panel

When this node is selected, it will display the Spline editor inside the Node viewer panel.


Curve editor