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

mix - linearly interpolate between two values

Declaration

genTypemix(genTypex,genTypey,genTypea);genTypemix(genTypex,genTypey,floata);genDTypemix(genDTypex,genDTypey,genDTypea);genDTypemix(genDTypex,genDTypey,doublea);genTypemix(genTypex,genTypey,genBTypea);genDTypemix(genDTypex,genDTypey,genBTypea);genITypemix(genITypex,genITypey,genBTypea);genUTypemix(genUTypex,genUTypey,genBTypea);genBTypemix(genBTypex,genBTypey,genBTypea);

Description

mix performs a linear interpolation between x and y using a to weight between them. The return value is
       computed as $x \times (1 - a) + y \times a$.

       The variants of mix where a is genBType select which vector each returned component comes from. For a
       component of a that is false, the corresponding component of x is returned. For a component of a that is
       true, the corresponding component of y is returned. Components of x and y that are not selected are
       allowed to be invalid floating-point values and will have no effect on the results.

Name

       mix - linearly interpolate between two values

Parameters

x
           Specify the start of the range in which to interpolate.

       y
           Specify the end of the range in which to interpolate.

       a
           Specify the value to use to interpolate between x and y.

See Also

min(), max()

Version Support

       ┌────────────────┬───────────────────────────────────────────────────────────────────────────────────┐
       │                │        OpenGLShadingLanguageVersion                                            │
       ├────────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
       │ Function1.101.201.301.401.503.304.004.104.204.304.404.50 │
       │ Name           │      │      │      │      │      │      │      │      │      │      │      │      │
       ├────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ mix(genType)   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       ├────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ mix(genDType)  │  -   │  -   │  -   │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       ├────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ mix(genIType), │  -   │  -   │  -   │  -   │  -   │  -   │  -   │  -   │  -   │  -   │  -   │  ✔   │
       │ mix(genUType), │      │      │      │      │      │      │      │      │      │      │      │      │
       │ mix(genBType)  │      │      │      │      │      │      │      │      │      │      │      │      │
       └────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘

See Also