# Documentation: What exactly is texture.channel for?

**URL:** <https://discourse.threejs.org/t/documentation-what-exactly-is-texture-channel-for/81168>\
**Category:** Site Feedback\
**Tags:** uv, documentation, texture, texture-channel\
**Created:** [April 14, 2025, 3:43am UTC](https://discourse.threejs.org/t/documentation-what-exactly-is-texture-channel-for/81168 "2025-04-14T03:43:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![trusktr](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/trusktr/32/13726_2.png) [@trusktr](https://discourse.threejs.org/u/trusktr)\
**Post date:** [April 14, 2025, 3:43am UTC](https://discourse.threejs.org/t/documentation-what-exactly-is-texture-channel-for/81168/1 "2025-04-14T03:43:03Z")

</div>

The [Texture.channel](https://threejs.org/docs/#api/en/textures/Texture.channel) docs say:

> Lets you select the uv attribute to map the texture to. `0` for `uv`, `1` for `uv1`, `2` for `uv2` and `3` for `uv3`.

But what are those? Why would you want to use those? Any working examples to look at?

There appears to be no documentation on this. I’d like to get this documented more clearly.

---

<div class="post-metadata">

**Author:** ![Fennec](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fennec/32/59265_2.png) [@Fennec](https://discourse.threejs.org/u/Fennec)\
**Post date:** [April 14, 2025, 5:00am UTC](https://discourse.threejs.org/t/documentation-what-exactly-is-texture-channel-for/81168/2 "2025-04-14T05:00:18Z")

</div>

This may be related to the material’s .[lightMap](https://threejs.org/docs/index.html#api/en/materials/MeshStandardMaterial.lightMap) and .[aoMap](https://threejs.org/docs/index.html#api/en/materials/MeshStandardMaterial.aoMap) properties.

> .[aoMap](https://threejs.org/docs/index.html#api/en/materials/MeshStandardMaterial.aoMap) : [Texture](https://threejs.org/docs/index.html#api/en/textures/Texture)  
> The red channel of this texture is used as the ambient occlusion map. Default is null. The aoMap requires a second set of UVs.

> [@How to use AOMap](https://discourse.threejs.org/t/how-to-use-aomap/22294/4):
>
> If you check the code from that example, it’s modifying the model after loading it to add the second UV set: This is necessary for formats like OBJ where the file does not contain the AO map and it has to be added afterward.

---

<div class="post-metadata">

**Author:** ![trusktr](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/trusktr/32/13726_2.png) [@trusktr](https://discourse.threejs.org/u/trusktr)\
**Post date:** [April 14, 2025, 5:45am UTC](https://discourse.threejs.org/t/documentation-what-exactly-is-texture-channel-for/81168/3 "2025-04-14T05:45:37Z")

</div>

Ah yes, that’s what it is for.

After digging into the source a bit (and seeing some git blames), I found what it is for, but the name “Texture.channel” really did not make this intuitive considering that textures already have “color channels”.

To explain it simply, [in WebGLProgram.js](https://github.com/mrdoob/three.js/blob/47206c5658430f45853f8406c6cdcbafb7b057df/src/renderers/webgl/WebGLProgram.js#L685-L703) we have this:

```javascript
			'attribute vec2 uv;',

			'#ifdef USE_UV1',

			'	attribute vec2 uv1;',

			'#endif',

			'#ifdef USE_UV2',

			'	attribute vec2 uv2;',

			'#endif',

			'#ifdef USE_UV3',

			'	attribute vec2 uv3;',

			'#endif',

```

and simply put, if we set `texture.channel = 1`, then the `uv1` attribute will be used instead of the `uv` attribute for the uv attributes that maps the texture to the mesh geometry.

With a geometry, then we can do this:

```js
const geometry = new BufferGeometry()
geometry.attributes.position = ...vertex positions...
geometry.attributes.uv2 = new Float32BufferAttribute([...uv values...], 2)
geometry.attributes.uv3 = new Float32BufferAttribute([...other uv values...], 2)

const texture = new TextureLoad().load('some-texture.jpg')
texture.channel = 2

const texture2 = new TextureLoad().load('some-texture.jpg')
texture2.channel = 3

const mat = new MeshPhysicalMaterial({
  map: texture,
  normalMap: texture2
})

```

then the `map` and the `normalMap` textures in the materials will use the two separate UVs instead one shared UV as usual.

This is interesting because, for example (I’m theorizing), up to four separate artists could map 4 textures (or 4 sets of textures) to a mesh using 4 different UVs without worrying about having coordinate on a single UV format.

> [@Fennec](#):
>
> The red channel of this texture is used as the ambient occlusion map. Default is null. The aoMap requires a second set of UVs.

Searching for “texture channel” doesn’t work well because, as you can see from that very example, the word “channel” is being used for the color channel. The property “texture.channel” would seem to be related to a color channel or similar.

Maybe something like `texture.uvId` or just `texture.uv` are better names?

---

<div class="post-metadata">

**Author:** ![Fennec](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fennec/32/59265_2.png) [@Fennec](https://discourse.threejs.org/u/Fennec)\
**Post date:** [April 14, 2025, 6:27am UTC](https://discourse.threejs.org/t/documentation-what-exactly-is-texture-channel-for/81168/4 "2025-04-14T06:27:58Z")

</div>

Add channel packing to the mix, and things get even more confusing. To be fair, everything about computer graphics is confusing, that’s part of what makes us special 🦄. (That is, until AI bumps in and suddenly we’re not _that_ special 💀)

---

<div class="post-metadata">

**Author:** ![manthrax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/manthrax/32/2596_2.png) [@manthrax](https://discourse.threejs.org/u/manthrax)\
**Post date:** [April 14, 2025, 11:58pm UTC](https://discourse.threejs.org/t/documentation-what-exactly-is-texture-channel-for/81168/5 "2025-04-14T23:58:00Z")

</div>

Specifically in the case of light mapping, lightmaps often don’t require nearly as high pixel density as diffuse textures since its generally lower frequency data. Additionally lightmaps are rarely tiled, whereas diffuse/etc are often tiled to cover large areas. Using separate channels for these kinds of data goes back to Quake1 days and earlier.
