--- title: "Math Float Shaders" url: "https://help.maxon.net/r3d/houdini/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-45-329b29.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-45-329b29.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-47-43a10.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-47-43a10.png) | Returns *Input 1* + *Input 2*. ## ArcCosine | | | --- | | ![Image: image2017-10-4_13-47-184817.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-47-184817.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-47-29e596.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-47-29e596.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-47-42b4db.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-47-42b4db.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-47-596bc4.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-47-596bc4.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-48-11cad8.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-48-11cad8.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-48-2439d2.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-48-2439d2.png) | Returns *Input* remapped from *Old Range* values to *New Range* values, with an optional clamp. ## Cosine | | | --- | | ![Image: image2017-10-4_13-48-37643f.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-48-37643f.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-49-25b2e5.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-49-25b2e5.png) | Returns *Input 1* / *Input 2*. ## Exp | | | --- | | ![Image: image2017-10-4_13-49-56b7cf.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-49-56b7cf.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-50-16b8ae.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-50-16b8ae.png) | Returns the integer part of *Input*. For example, 1.5 will be returned as 1.0. ## Frac | | | --- | | ![Image: image2017-10-4_13-50-27347d.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-50-27347d.png) | Returns the fractional part of *Input*. For example, 1.5 will be returned as 0.5. ## Gain | | | --- | | ![Image: image2017-10-4_13-50-39e448.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-50-39e448.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-50-51dd81.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-50-51dd81.png) | Returns the 1 - *Input*. ## Ln | | | --- | | ![Image: image2017-10-4_13-51-47751.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-51-47751.png) | Returns the natural logarithm (to base e) of *Input*. > **Note:** This is the inverse function of Exp. ## Log | | | --- | | ![Image: image2017-10-4_13-51-16c48f.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-51-16c48f.png) | Returns the logarithm of *Input* to *Base*. > **Note:** This is the inverse function of Pow. ## Max | | | --- | | ![Image: image2017-10-4_13-51-2717df.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-51-2717df.png) | Returns the maximum of *Input 1* and *Input 2*. ## Min | | | --- | | ![Image: image2017-10-4_13-51-4008c5.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-51-4008c5.png) | Returns the minimum of *Input 1* and *Input 2*. ## Mix | | | --- | | ![Image: image2017-10-4_13-51-52d0ff.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-51-52d0ff.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-52-54515.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-52-54515.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-52-1767d9.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-52-1767d9.png) | Returns *Input 1* \* *Input 2*. ## Neg | | | --- | | ![Image: image2017-10-4_13-52-29784f.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-52-29784f.png) | Returns 0 - *Input*. ## Pow | | | --- | | ![Image: image2017-10-4_13-52-42a7ae.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-52-42a7ae.png) | Returns *Base*^ *Exponent*. > **Note:** This is the inverse function of Log. ## Rcp | | | --- | | ![Image: image2017-10-4_13-52-5560d9.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-52-5560d9.png) | Returns 1 / *Input*. ## Saturate | | | --- | | ![Image: image2017-10-4_13-53-1163d4.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-53-1163d4.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-53-23a4e7.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-53-23a4e7.png) | Returns -1 if *Input* is a negavitve number and 1 otherwise. ## Sine | | | --- | | ![Image: image2017-10-4_13-54-6d7a6.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-54-6d7a6.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-54-27afe3.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-54-27afe3.png) | Returns the square-root of *Input*. ## Sub | | | --- | | ![Image: image2017-10-4_13-54-4752cf.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-54-4752cf.png) | Returns *Input 1* - *Input 2*. ## Tangent | | | --- | | ![Image: image2017-10-4_13-54-59457e.png](https://help.maxon.net/r3d/houdini/en-us/Content/Resources/Images/image2017-10-4_13-54-59457e.png) | Returns the tangent of *Input*. When *Radians* is selected, the input will be assumed to be in radians, otherwise degrees.