mix
Performs a linear interpolation between two values (e.g., colors, vectors, or floats) based on a weight factor, creating a smooth blend or transition.
Core Advantages
Provides a clear, concise node that calls the underlying, highly-optimized native hardware mix function, significantly improving shader code readability, maintainability, and performance.
Common Uses
Blending two colors or textures using a mask.
Creating smooth animations between two states by using a time node as the mix factor.
Controlling PBR material properties, such as mixing between clean and dirty roughness values, using a texture.
Creating soft edges for procedural shapes when combined with the smoothstep node.
How to adjust
Imagine the mix factor 't' as a fader from 0 to 1. When t=0, the result is the start value 'a'; when t=1, the result is the end value 'b'; at t=0.5, it's a 50/50 blend. Connecting 't' to uv().x creates a smooth spatial gradient from 'a' to 'b' across an object. Connecting it to a time-based node creates an animation.
Code Examples
1// Blends between a and b using the mix factor t
2// result = a * (1.0 - t) + b * t
3const finalResult = mix( a, b, t );