MIX(3G)

    .SH "NAME" mix - linearly interpolate between two values
    .SH "DECLARATION"

            .HP u genType mix(genType x, genType y, genType a);

            .HP u genType mix(genType x, genType y, float a);

            .HP u genDType mix(genDType x, genDType y, genDType a);

            .HP u genDType mix(genDType x, genDType y, double a);

            .HP u genType mix(genType x, genType y, genBType a);

            .HP u genDType mix(genDType x, genDType y, genBType a);

            .HP u genIType mix(genIType x, genIType y, genBType a);

            .HP u genUType mix(genUType x, genUType y, genBType a);

            .HP u genBType mix(genBType x, genBType y, genBType a);

    .SH "PARAMETERS"

        .PP x

                    Specify the start of the range in which to interpolate.

            .RE
            .PP y

                        Specify the end of the range in which to interpolate.

                .RE
                .PP a

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

                    .RE

                .SH "DESCRIPTION"
                    .PP 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$.
                    .PP 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.

                .SH "VERSION SUPPORT"
                    .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ OpenGL Shading Language Version T} T{ Function Name T}:T{ 1.10 T}:T{ 1.20 T}:T{ 1.30 T}:T{ 1.40 T}:T{ 1.50 T}:T{ 3.30 T}:T{ 4.00 T}:T{ 4.10 T}:T{ 4.20 T}:T{ 4.30 T}:T{ 4.40 T}:T{ 4.50 T} l c c c c c c c c c c c c l c c c c c c c c c c c c l c c c c c c c c c c c c. T{ mix(genType) T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} T{ mix(genDType) T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} T{ mix(genIType), mix(genUType), mix(genBType) T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ ✔ T}

                .SH "SEE ALSO"
                    .PP min(), max()

                .SH "COPYRIGHT"
                    .PP Copyright © 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. https://opencontent.org/openpub/.

COPYRIGHT
Copyright © 2011-2014 Khronos Group