--- title: "Math Float Shaders" url: "https://help.maxon.net/r3d/3dsmax/en-us/Content/html/Math%2BScalar%2BShaders.html" section_path: "Shaders > Math Shaders > Math Float Shaders" description: "Redshift supports a wide variety of commonly used math operation shaders for both scalar (float) values and vectors. All math nodes that process float …" --- # Math Float Shaders You are here: # Math Float Shaders ## Introduction Redshift supports a wide variety of commonly used math operation shaders for both scalar (float) values and vectors. All math nodes that process float values are listed here: ## Abs | | | --- | | ![Image: 3dsmax_2018-08-27_11-18-4688b4.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-18-4688b4.png) | Returns the absolute value of *Input*. For example, a value of -1.0 will be returned as 1.0. ## Add | | | --- | | ![Image: 3dsmax_2018-08-27_11-19-21403b.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-19-21403b.png) | Returns *Input 1* + *Input 2*. ## ArcCosine | | | --- | | ![Image: 3dsmax_2018-08-27_11-20-12651e.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-20-12651e.png) | Returns the arc-cosine of *Input*. When *Radians* is selected, the output range will be between 0 and PI, otherwise 0 and 180 degrees. ## ArcSine | | | --- | | ![Image: 3dsmax_2018-08-27_11-21-56434c.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-21-56434c.png) | Returns the arc-sine of *Input*. When *Radians* is selected, the output range will be between -PI/2 and PI/2, otherwise -90 and 90 degrees. ## ArcTan2 | | | --- | | ![Image: 3dsmax_2018-08-27_11-22-22bd25.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-22-22bd25.png) | Returns the arc-tangent of *Input 1* and *Input 2*. When *Radians* is selected, the output range will be between -PI/2 and PI/2, otherwise -90 and 90 degrees. ## ArcTangent | | | --- | | ![Image: 3dsmax_2018-08-27_11-22-495799.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-22-495799.png) | Returns the arc-tangent of *Input*. When *Radians* is selected, the output range will be between -PI/2 and PI/2, otherwise -90 and 90 degrees. ## Bias | | | --- | | ![Image: 3dsmax_2018-08-27_11-23-11fb98.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-23-11fb98.png) | Returns a curved bias of *Input* by *Bias*, using the following Ken Perlin formula: pow(*Input*, log(*Bias*)/log(0.5)) ## Change Range | | | --- | | ![Image: 3dsmax_2018-08-27_11-23-37baac.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-23-37baac.png) | Returns *Input* remapped from *Old Range* values to *New Range* values, with an optional clamp. ## Cosine | | | --- | | ![Image: 3dsmax_2018-08-27_11-24-140de1.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-24-140de1.png) | Returns the cosine of *Input*. When *Radians* is selected, the input will be assumed to be in radians, otherwise degrees. ## Div | | | --- | | ![Image: 3dsmax_2018-08-27_11-24-38057a.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-24-38057a.png) | Returns *Input 1* / *Input 2*. ## Exp | | | --- | | ![Image: 3dsmax_2018-08-27_11-27-31dcbd.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-27-31dcbd.png) | Returns the exponential of *Input*, using the following formula: e^ *Input* > **Note:** This is the inverse function of Ln. ## Floor | | | --- | | ![Image: 3dsmax_2018-08-27_11-27-58314f.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-27-58314f.png) | Returns the integer part of *Input*. For example, 1.5 will be returned as 1.0. ## Frac | | | --- | | ![Image: 3dsmax_2018-08-27_11-28-225106.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-28-225106.png) | Returns the fractional part of *Input*. For example, 1.5 will be returned as 0.5. ## Gain | | | --- | | ![Image: 3dsmax_2018-08-27_11-28-50084a.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-28-50084a.png) | Returns a contrast gain of *Input* by *Gain*, using the following Ken Perlin formula: Bias( 2 \* *Input*, 1 - *Gain* ) \* 0.5               ; if Input \< 0.5 1 - Bias(  2 - 2 \* *Input*, 1 - *Gain* ) \* 0.5    ; otherwise ## Invert | | | --- | | ![Image: 3dsmax_2018-08-27_11-29-07762a.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-29-07762a.png) | Returns the 1 - *Input*. ## Ln | | | --- | | ![Image: 3dsmax_2018-08-27_11-29-22f443.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-29-22f443.png) | Returns the natural logarithm (to base e) of *Input*. > **Note:** This is the inverse function of Exp. ## Log | | | --- | | ![Image: 3dsmax_2018-08-27_11-29-546a38.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-29-546a38.png) | Returns the logarithm of *Input* to *Base*. > **Note:** This is the inverse function of Pow. ## Max | | | --- | | ![Image: 3dsmax_2018-08-27_11-30-14bbd8.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-30-14bbd8.png) | Returns the maximum of *Input 1* and *Input 2*. ## Min | | | --- | | ![Image: 3dsmax_2018-08-27_11-30-32c83b.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-30-32c83b.png) | Returns the minimum of *Input 1* and *Input 2*. ## Mix | | | --- | | ![Image: 3dsmax_2018-08-27_11-30-52865f.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-30-52865f.png) | Returns *Input 1* linearly interpolated to *Input 2* by *Mix*. When *Mix* is 0.0, *Input 1* will be returned. When *Mix* is 1.0, *Input 2* will be returned. ## Mod | | | --- | | ![Image: 3dsmax_2018-08-27_11-31-133896.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-31-133896.png) | Returns the modulo of *Input* by *Divisor*. For example 7 modulo 5 will be returned as 2. > **Note:** This is the remainder of Input / Divisor. ## Mul | | | --- | | ![Image: 3dsmax_2018-08-27_11-31-315801.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-31-315801.png) | Returns *Input 1* \* *Input 2*. ## Neg | | | --- | | ![Image: 3dsmax_2018-08-27_11-31-48fa9c.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-31-48fa9c.png) | Returns 0 - *Input*. ## Pow | | | --- | | ![Image: 3dsmax_2018-08-27_11-32-08a568.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-32-08a568.png) | Returns *Base*^ *Exponent*. > **Note:** This is the inverse function of Log. ## Rcp | | | --- | | ![Image: 3dsmax_2018-08-27_11-32-24ed62.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-32-24ed62.png) | Returns 1 / *Input*. ## Saturate | | | --- | | ![Image: 3dsmax_2018-08-27_11-32-4432a3.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-32-4432a3.png) | Returns *Input* clamped to values between 0 and 1, inclusively. For example -1.5 will be returned as 0.0 and 1.5 will be returned as 1.0. ## Sign | | | --- | | ![Image: 3dsmax_2018-08-27_11-33-05af15.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-33-05af15.png) | Returns -1 if *Input* is a negavitve number and 1 otherwise. ## Sine | | | --- | | ![Image: 3dsmax_2018-08-27_11-33-234fd8.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-33-234fd8.png) | Returns the sine of *Input*. When *Radians* is selected, the input will be assumed to be in radians, otherwise degrees. ## Sqrt | | | --- | | ![Image: 3dsmax_2018-08-27_11-33-53e00c.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-33-53e00c.png) | Returns the square-root of *Input*. ## Sub | | | --- | | ![Image: 3dsmax_2018-08-27_11-34-1035af.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-34-1035af.png) | Returns *Input 1* - *Input 2*. ## Tangent | | | --- | | ![Image: 3dsmax_2018-08-27_11-34-327860.png](https://help.maxon.net/r3d/3dsmax/en-us/Content/Resources/Images/3dsmax_2018-08-27_11-34-327860.png) | Returns the tangent of *Input*. When *Radians* is selected, the input will be assumed to be in radians, otherwise degrees.