--- title: "Math Float Shaders" url: "https://help.maxon.net/r3d/cinema/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: image2017-10-4_13-16-148745.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-16-148745.png) | Returns the absolute value of *Input*. For example, a value of -1.0 will be returned as 1.0. ## Add | | | --- | | ![Image: image2017-10-4_13-18-12db84.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-18-12db84.png) | Returns *Input 1* + *Input 2*. ## ArcCosine | | | --- | | ![Image: image2017-10-4_13-18-30697f.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-18-30697f.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: image2017-10-4_13-18-52d6c0.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-18-52d6c0.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: image2017-10-4_13-19-12a7ba.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-19-12a7ba.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: image2017-10-4_13-19-25da61.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-19-25da61.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: image2017-10-4_13-19-431b07.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-19-431b07.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: image2017-10-4_13-20-06c7b.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-20-06c7b.png) | Returns *Input* remapped from *Old Range* values to *New Range* values, with an optional clamp. ## Cosine | | | --- | | ![Image: image2017-10-4_13-20-42063a.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-20-42063a.png) | Returns the cosine of *Input*. When *Radians* is selected, the input will be assumed to be in radians, otherwise degrees. ## Div | | | --- | | ![Image: image2017-10-4_13-21-877bb.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-21-877bb.png) | Returns *Input 1* / *Input 2*. ## Exp | | | --- | | ![Image: image2017-10-4_13-21-48ae0a.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-21-48ae0a.png) | Returns the exponential of *Input*, using the following formula: e^ *Input* > **Note:** This is the inverse function of Ln. ## Floor | | | --- | | ![Image: image2017-10-4_13-22-400f6.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-22-400f6.png) | Returns the integer part of *Input*. For example, 1.5 will be returned as 1.0. ## Frac | | | --- | | ![Image: image2017-10-4_13-22-16867b.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-22-16867b.png) | Returns the fractional part of *Input*. For example, 1.5 will be returned as 0.5. ## Gain | | | --- | | ![Image: image2017-10-4_13-22-353853.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-22-353853.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: image2017-10-4_13-22-47ff0a.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-22-47ff0a.png) | Returns the 1 - *Input*. ## Ln | | | --- | | ![Image: image2017-10-4_13-23-14deaa.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-23-14deaa.png) | Returns the natural logarithm (to base e) of *Input*. > **Note:** This is the inverse function of Exp. ## Log | | | --- | | ![Image: image2017-10-4_13-23-4086f0.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-23-4086f0.png) | Returns the logarithm of *Input* to *Base*. > **Note:** This is the inverse function of Pow. ## Max | | | --- | | ![Image: image2017-10-4_13-23-5397a8.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-23-5397a8.png) | Returns the maximum of *Input 1* and *Input 2*. ## Min | | | --- | | ![Image: image2017-10-4_13-24-26be4.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-24-26be4.png) | Returns the minimum of *Input 1* and *Input 2*. ## Mix | | | --- | | ![Image: image2017-10-4_13-24-16e6f7.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-24-16e6f7.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: image2017-10-4_13-24-287061.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-24-287061.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: image2017-10-4_13-24-42ad89.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-24-42ad89.png) | Returns *Input 1* \* *Input 2*. ## Neg | | | --- | | ![Image: image2017-10-4_13-25-322b24.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-25-322b24.png) | Returns 0 - *Input*. ## Pow | | | --- | | ![Image: image2017-10-4_13-25-438c20.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-25-438c20.png) | Returns *Base*^ *Exponent*. > **Note:** This is the inverse function of Log. ## Rcp | | | --- | | ![Image: image2017-10-4_13-25-538836.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-25-538836.png) | Returns 1 / *Input*. ## Saturate | | | --- | | ![Image: image2017-10-4_13-26-54fb1.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-26-54fb1.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: image2017-10-4_13-26-151aff.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-26-151aff.png) | Returns -1 if *Input* is a negavitve number and 1 otherwise. ## Sine | | | --- | | ![Image: image2017-10-4_13-26-31dcb3.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-26-31dcb3.png) | Returns the sine of *Input*. When *Radians* is selected, the input will be assumed to be in radians, otherwise degrees. ## Sqrt | | | --- | | ![Image: image2017-10-4_13-26-457a33.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-26-457a33.png) | Returns the square-root of *Input*. ## Sub | | | --- | | ![Image: image2017-10-4_13-26-58e2cb.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-26-58e2cb.png) | Returns *Input 1* - *Input 2*. ## Tangent | | | --- | | ![Image: image2017-10-4_13-27-945e6.png](https://help.maxon.net/r3d/cinema/en-us/Content/Resources/Images/image2017-10-4_13-27-945e6.png) | Returns the tangent of *Input*. When *Radians* is selected, the input will be assumed to be in radians, otherwise degrees.