logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

smoothstep - perform Hermite interpolation between two values

Declaration

genTypesmoothstep(genTypeedge0,genTypeedge1,genTypex);genTypesmoothstep(floatedge0,floatedge1,genTypex);genDTypesmoothstep(genDTypeedge0,genDTypeedge1,genDTypex);genDTypesmoothstep(doubleedge0,doubleedge1,genDTypex);

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:

               genType t;  /* Or genDType t; */
               t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
               return t * t * (3.0 - 2.0 * t);

       Results are undefined if edge0edge1.

Name

       smoothstep - perform Hermite interpolation between two values

Parameters

edge0
           Specifies the value of the lower edge of the Hermite function.

       edge1
           Specifies the value of the upper edge of the Hermite function.

       x
           Specifies the source value for interpolation.

See Also

mix(), step()

Version Support

       ┌────────────┬───────────────────────────────────────────────────────────────────────────────────┐
       │            │        OpenGLShadingLanguageVersion                                            │
       ├────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
       │ Function1.101.201.301.401.503.304.004.104.204.304.404.50 │
       │ Name       │      │      │      │      │      │      │      │      │      │      │      │      │
       ├────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ smoothstep │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       │ (genType)  │      │      │      │      │      │      │      │      │      │      │      │      │
       ├────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ smoothstep │  -   │  -   │  -   │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       │ (genDType) │      │      │      │      │      │      │      │      │      │      │      │      │
       └────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘

See Also