1. Home
  2. Docs
  3. PopcornFX v2.7
  4. Scripting reference
  5. Samplers
  6. Curve sampler

Curve sampler

Curve sampler

Sampling functions

Return typeDescription
float#SamplerName.sample(float cursor)
Samples the curve at coordinate cursor on the horizontal axis.The return type is a float vector whose dimension matches the curve dimension.
A 1D curve will return a float, 3D curve will return a float3, etc…
floatSamplerName.sampleCDF(float cursor)
Treats the curve as a Probability Density Function (PDF), and samples its Cumulative Density Function (CDF) at coordinate cursor on the horizontal axis.Only works for float curves (single channel / 1D).
Useful to get custom random distributions by doing Curve.sampleCDF(rand(0,1))
float#SamplerName.derive(float cursor)
Computes the derivative of the curve sampler curve at coordinate cursor on the horizontal axis.Return type is a float vector whose dimension matches the curve dimension.
Each xyzw element of the result will contain the derivative of each of the separate curve components.
float#SamplerName.integrate(float cursorBegin, float cursorEnd)
Computes the integral of the curve sampler curve between coordinates cursorBegin and cursorEnd on the horizontal axis.Return type is a float vector whose dimension matches the curve dimension.
Each xyzw element of the result will contain the integral of each of the separate curve components.
Was this article helpful to you? Yes No

How can we help?