> For the complete documentation index, see [llms.txt](https://docs.lightact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lightact.com/layers-and-layouts/stock-layer-templates/generative-layer-templates/channel-mixer.md).

# Channel mixer

<figure><img src="/files/bgyme1XpPM1wiiCqEEKW" 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
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](/layers-and-layouts/stock-layer-templates.md).

### **Texture channel mixer**

<div align="left"><figure><img src="/files/6OCTkzztPoKyeivjaEtY" alt=""><figcaption></figcaption></figure></div>

* **Input 1**: the first of the two input textures. It needs to come from another layer using [Layer connections](/layers-and-layouts/layer-connections.md).
* **Input 2**: the second of the two input textures. It needs to come from another layer using [Layer connections](/layers-and-layouts/layer-connections.md).
* **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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lightact.com/layers-and-layouts/stock-layer-templates/generative-layer-templates/channel-mixer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
