A shader function that performs smooth Hermite interpolation between 0.0 and 1.0.
This function is equivalent to the GLSL built-in smoothstep(edge0, edge1, x) and is available inside p5.strands shader callbacks. It is commonly used to create soft transitions, smooth edges, fades, and anti-aliased effects.
Smoothstep is useful when a threshold or cutoff is needed, but with a gradual transition instead of a hard edge.
- Returns
0.0whenxis less than or equal toedge0 - Returns
1.0whenxis greater than or equal toedge1 - Smoothly interpolates between
0.0and1.0whenxis between them
Ejemplos
Sintaxis
smoothstep(edge0, edge1, x)
Parámetros
Returns
0.0 and 1.0Referencias Relacionadas
baseColorShader
Returns the default shader used for fills when no lights or textures are activate.
baseFilterShader
Returns the base shader used for filters.
baseMaterialShader
Returns the default shader used for fills when lights or textures are used.
baseNormalShader
Returns the default shader used for fills when normalMaterial() is activated.