'\" t .\" Title: mix .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 05/21/2015 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "MIX" "3G" "05/21/2015" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" mix \- linearly interpolate between two values .SH "DECLARATION" .HP \w'genType\ mix('u .BI "genType mix(genType\ " "x" ", genType\ " "y" ", genType\ " "a" ");" .HP \w'genType\ mix('u .BI "genType mix(genType\ " "x" ", genType\ " "y" ", float\ " "a" ");" .HP \w'genDType\ mix('u .BI "genDType mix(genDType\ " "x" ", genDType\ " "y" ", genDType\ " "a" ");" .HP \w'genDType\ mix('u .BI "genDType mix(genDType\ " "x" ", genDType\ " "y" ", double\ " "a" ");" .HP \w'genType\ mix('u .BI "genType mix(genType\ " "x" ", genType\ " "y" ", genBType\ " "a" ");" .HP \w'genDType\ mix('u .BI "genDType mix(genDType\ " "x" ", genDType\ " "y" ", genBType\ " "a" ");" .HP \w'genIType\ mix('u .BI "genIType mix(genIType\ " "x" ", genIType\ " "y" ", genBType\ " "a" ");" .HP \w'genUType\ mix('u .BI "genUType mix(genUType\ " "x" ", genUType\ " "y" ", genBType\ " "a" ");" .HP \w'genBType\ mix('u .BI "genBType mix(genBType\ " "x" ", genBType\ " "y" ", genBType\ " "a" ");" .SH "PARAMETERS" .PP \fIx\fR .RS 4 Specify the start of the range in which to interpolate\&. .RE .PP \fIy\fR .RS 4 Specify the end of the range in which to interpolate\&. .RE .PP \fIa\fR .RS 4 Specify the value to use to interpolate between \fIx\fR and \fIy\fR\&. .RE .SH "DESCRIPTION" .PP \fBmix\fR performs a linear interpolation between \fIx\fR and \fIy\fR using \fIa\fR to weight between them\&. The return value is computed as $x \etimes (1 \- a) + y \etimes a$\&. .PP The variants of \fBmix\fR where \fIa\fR is \fBgenBType\fR select which vector each returned component comes from\&. For a component of \fIa\fR that is false, the corresponding component of \fIx\fR is returned\&. For a component of \fIa\fR that is true, the corresponding component of \fIy\fR is returned\&. Components of \fIx\fR and \fIy\fR 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{ \fBOpenGL Shading Language Version\fR T} T{ \fBFunction Name\fR T}:T{ \fB1\&.10\fR T}:T{ \fB1\&.20\fR T}:T{ \fB1\&.30\fR T}:T{ \fB1\&.40\fR T}:T{ \fB1\&.50\fR T}:T{ \fB3\&.30\fR T}:T{ \fB4\&.00\fR T}:T{ \fB4\&.10\fR T}:T{ \fB4\&.20\fR T}:T{ \fB4\&.30\fR T}:T{ \fB4\&.40\fR T}:T{ \fB4\&.50\fR T} .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} .TE .sp .SH "SEE ALSO" .PP \fBmin\fR(), \fBmax\fR() .SH "COPYRIGHT" .PP Copyright \(co 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\&. \m[blue]\fBhttp://opencontent\&.org/openpub/\fR\m[]\&. .SH "COPYRIGHT" .br Copyright \(co 2011-2014 Khronos Group .br