MIX (math/mix/float)
The MIX node performs a linear interpolation between two float values based on a third float value. It allows you to smoothly blend between two numbers by specifying a mix factor.Inputs
a(float, default: 0): The first value to interpolate between.b(float, default: 0): The second value to interpolate between.c(float, default: 0): The mix factor that determines the interpolation amount. A value of 0 returnsa, a value of 1 returnsb, and values in between return a linear blend ofaandb.
Outputs
result(float): The interpolated value betweenaandbbased on the mix factorc.
Configuration
This node has no additional configuration options.Usage
To use the MIX node:- Connect the first value you want to interpolate between to the
ainput. - Connect the second value you want to interpolate between to the
binput. - Connect a value between 0 and 1 to the
cinput to control the interpolation amount. - The interpolated result will be available at the
resultoutput.
Example
Here’s an example of how you might use the MIX node in a spell:input1andinput2are two sliders that provide the values to interpolate between.mixFactoris a slider that controls the interpolation amount.- The MIX node interpolates between
input1andinput2based onmixFactor. - The interpolated result is displayed using a Debug node.
Best Practices
- Ensure the
cinput is always between 0 and 1. Values outside this range will be clamped. - MIX is useful for creating smooth transitions, fades, and blends between two values.
- You can chain multiple MIX nodes together to interpolate between more than two values.
Common Issues
- If the interpolated result is not what you expect, double check that the
cinput is between 0 and 1. - Be aware that the MIX node does a simple linear interpolation. For other types of interpolation, like easing functions, you’ll need to use different math nodes.
