<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ShaderGraph-Docs",
  "identifier" : "/documentation/ShaderGraph/Compositing/Mix",
  "metadataVersion" : "0.1.0",
  "role" : "ShaderGraph Node",
  "symbol" : {
    "kind" : "ShaderGraph Node",
    "modules" : [
      "ShaderGraph"
    ],
    "preciseIdentifier" : "Shader_ND_mix_float"
  },
  "title" : "Mix"
}
-->

# Mix

Mixes foreground and background inputs, weighting based on mix value.

## Overview

F * m + B(1 - m)

## Parameter Types

**Mix (float):**

|Input       |Type |
                |------------|-----|
                |`Foreground`|Float|
                |`Background`|Float|
                |`Mix`       |Float|

|Output|Type |
                |------|-----|
                |`Out` |Float|

**Mix (color3f):**

|Input       |Type         |
                |------------|-------------|
                |`Foreground`|Color3<Float>|
                |`Background`|Color3<Float>|
                |`Mix`       |Float        |

|Output|Type         |
                |------|-------------|
                |`Out` |Color3<Float>|

**Mix (vector3h):**

|Input       |Type    |
                |------------|--------|
                |`Foreground`|Vector3h|
                |`Background`|Vector3h|
                |`Mix`       |Float   |

|Output|Type    |
                |------|--------|
                |`Out` |Vector3h|

**Mix (half):**

|Input       |Type|
                |------------|----|
                |`Foreground`|Half|
                |`Background`|Half|
                |`Mix`       |Half|

|Output|Type|
                |------|----|
                |`Out` |Half|

**Mix (vector2h):**

|Input       |Type    |
                |------------|--------|
                |`Foreground`|Vector2h|
                |`Background`|Vector2h|
                |`Mix`       |Float   |

|Output|Type    |
                |------|--------|
                |`Out` |Vector2h|

**Mix (vector2f):**

|Input       |Type    |
                |------------|--------|
                |`Foreground`|Vector2f|
                |`Background`|Vector2f|
                |`Mix`       |Float   |

|Output|Type    |
                |------|--------|
                |`Out` |Vector2f|

**Mix (color4f):**

|Input       |Type         |
                |------------|-------------|
                |`Foreground`|Color4<Float>|
                |`Background`|Color4<Float>|
                |`Mix`       |Float        |

|Output|Type         |
                |------|-------------|
                |`Out` |Color4<Float>|

**Mix (vector3f):**

|Input       |Type    |
                |------------|--------|
                |`Foreground`|Vector3f|
                |`Background`|Vector3f|
                |`Mix`       |Float   |

|Output|Type    |
                |------|--------|
                |`Out` |Vector3f|

**Mix (vector4f):**

|Input       |Type    |
                |------------|--------|
                |`Foreground`|Vector4f|
                |`Background`|Vector4f|
                |`Mix`       |Float   |

|Output|Type    |
                |------|--------|
                |`Out` |Vector4f|

**Mix (vector4h):**

|Input       |Type    |
                |------------|--------|
                |`Foreground`|Vector4h|
                |`Background`|Vector4h|
                |`Mix`       |Float   |

|Output|Type    |
                |------|--------|
                |`Out` |Vector4h|

## Parameter descriptions

- `Foreground`: The foreground input.
- `Background`: The background input.
- `Mix`: The weight that determines what the output value is closer to. The default value is `0`. Values outside of the range `0-1` produce an undefined effect outside of the node’s intended function.

## Discussion

The Mix node blends two input values together, represented by the equation `F * m + B(1 - m)`.  If the `Mix` value is `1`, the output is identical to the `Foreground` value. If the value is `0`, the output is identical to the `Background` value.
The closer the `Mix` value is to `0` or `1`, the closer the output will be to the corresponding input.
Use the Mix node to blend between two different textures and create transtions or effects, interpolate between two colors, or mix shader parameters.
Below is an example of a simple node graph that uses the Mix node to blend two images together into a single material:

![](images/ShaderGraph-Docs/MixGraph~dark.png)

Below are the original two images and the resulting mixed texture applied to a cube with `Mix` values of `0.1`, `0.5`, and `0.9`:



![](images/ShaderGraph-Docs/MixMaterial1~dark.png)



![](images/ShaderGraph-Docs/MixMaterial2~dark.png)



![](images/ShaderGraph-Docs/MixMaterial3.png)



![](images/ShaderGraph-Docs/MixMaterial4.png)



![](images/ShaderGraph-Docs/MixMaterial5.png)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)