gl_smoothstep


  • Where to find it:


    • NodeGraph / Right Mouse Click / Add Nodes / Math / Extension Pack / S /




Description


smoothstep performs smooth Hermite interpolation between 0 and 1 when edge0 < x < edge1. 

This is useful in cases where a threshold function with a smooth transition is desired. smoothstep is equivalent to:


    t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);

    return t * t * (3.0 - 2.0 * t);


Results are undefined if edge0 ≥ edge1.


OpenGl Reference


https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/smoothstep.xhtml

Node Ports


  • Edge 1

Specifies the value of the lower edge of the Hermite function


  • Edge 2

Specifies the value of the upper edge of the Hermite function


  • X

Specifies the source value for interpolation

Node Outputs


  • Output RGB

Separate computation for Input Channels Red, Green, Blue with an Alpha Channel of 1.0


  • R

Computation for Input Red channel only, saved into R, G and B channel with an Alpha of 1.0


  • G

Computation for Input Green channel only, saved into R, G and B channel with an Alpha of 1.0


  • B

Computation for Input Blue channel only, saved into R, G and B channel with an Alpha of 1.0


  • A

Computation for Input Alpha channel only, saved into R, G and B channel with an Alpha of 1.0