# Channel mixer

<figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2FZKNgBzxJPxnunIlhpEAi%2Fimage.png?alt=media&#x26;token=2a4408b6-76a3-42ff-a7bf-49b721325a5b" alt=""><figcaption></figcaption></figure>

**Channel mixer** is a layer template that takes 2 textures and mixes their channels in an arbitrary way to create its output texture.

In the image above what's happening is this:

1. Color grid is rendered to the video screen first. That's just for visualisation of the alpha.
2. The 2 gradients are feeding their outputs into the Channel mixer layer&#x20;
3. Channel mixer layer is mixing (rerouting) their channels to create the texture that is rendered on top of the Color grid.

{% hint style="warning" %}
Please make sure that all the generative layers that are feeding the *Channel mixer* layer have their *Resolution mode* set to *Custom*.
{% endhint %}

## Variables

### **Render**

Explained in [Stock Layer Templates](https://docs.lightact.com/layers-and-layouts/stock-layer-templates).

### **Texture channel mixer**

<div align="left"><figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2FkMEHQkpo5GuAVjgjE6uP%2Fimage.png?alt=media&#x26;token=5010ff03-5d80-4517-9f6f-4617b95c44af" alt=""><figcaption></figcaption></figure></div>

* **Input 1**: the first of the two input textures. It needs to come from another layer using [Layer connections](https://docs.lightact.com/layers-and-layouts/layer-connections).
* **Input 2**: the second of the two input textures. It needs to come from another layer using [Layer connections](https://docs.lightact.com/layers-and-layouts/layer-connections).
* **R source**: using the dropdown specify which channel of the 2 input textures will be used for the R channel of the output texture.
* **G source**: using the dropdown specify which channel of the 2 input textures will be used for the G channel of the output texture.
* **B source**: using the dropdown specify which channel of the 2 input textures will be used for the B channel of the output texture.
* **A source**: using the dropdown specify which channel of the 2 input textures will be used for the A channel of the output texture.

{% hint style="info" %}
**Good to know:** if you are using a black & white texture without alpha as the alpha matte (where white means completely transparent and black completely opaque), then you need to set the A source as either R, G or B (but not A) of that texture.
{% endhint %}
