<p>What you see in the image called a <a href="https://en.wikipedia.org/wiki/UV_mapping" rel="nofollow noreferrer">UV map</a>. That is, it is simply texture coordinates to be looked up encoded in a image. Same thing happens in all texture lookup in 3D there is a underlying sampler that picks where to pick texture color from.</p>

<p><a href="https://i.sstatic.net/BhNr6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BhNr6.png" alt="enter image description here"></a></p>

<p><strong>Image 1</strong>: Image showing UV map of two overlapped triangles and sampled texture with same UV coords</p>

<p>Here are the sources for those images, please do not overwrite the sources.</p>

<ul>
<li><a href="http://webglplayground.net/saved/CZTXXQeZFH" rel="nofollow noreferrer">Demo</a> showing the UV map</li>
<li><a href="http://webglplayground.net/saved/tTnh7zvUc6" rel="nofollow noreferrer">Demo</a> showing the texture</li>
</ul>

CC BY-SA 3.0
2015-10-02T11:00:20.730Z
2015-10-02T11:39:23.227Z
2015-10-02T11:39:23.227Z
joojaa
<p>I'm in the process of making a tool that requires rendered texture to follow the contours of a piece of clothing. An example would be this website <a href="https://knyttan.com/editor/jumper-editor/" rel="nofollow noreferrer">https://knyttan.com/editor/jumper-editor/</a>. The effect here is achieved by using a colour map:<a href="https://i.sstatic.net/pcCgx.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pcCgx.jpg" alt="enter image description here"></a></p>

<p>I looked at the shaders that are used for this and it seems that the texture offset is calculated based on the colour channels from this map. </p>

<p>Now I was wondering if this is a complete bespoke way of doing this, or if this is a known technique and if it is what is it called ?</p>

<texture><webgl>
Help me find out what this texture mapping technique is called
Lukas Kriaučiūnas
# Help me find out what this texture mapping technique is called

(Asked by: username_0 on 2015-10-02)

I'm in the process of making a tool that requires rendered texture to follow the contours of a piece of clothing. An example would be this website <https://knyttan.com/editor/jumper-editor/>. The effect here is achieved by using a colour map:[![enter image description here](https://i.sstatic.net/pcCgx.jpg)](https://i.sstatic.net/pcCgx.jpg)

I looked at the shaders that are used for this and it seems that the texture offset is calculated based on the colour channels from this map.

Now I was wondering if this is a complete bespoke way of doing this, or if this is a known technique and if it is what is it called ?

**Tags:** texture, webgl


---

## 1 answers

### Answer by username_1 on 2015-10-02. Score: 8 | Accepted answer

What you see in the image called a [UV map](https://en.wikipedia.org/wiki/UV_mapping). That is, it is simply texture coordinates to be looked up encoded in a image. Same thing happens in all texture lookup in 3D there is a underlying sampler that picks where to pick texture color from.

[![enter image description here](https://i.sstatic.net/BhNr6.png)](https://i.sstatic.net/BhNr6.png)

**Image 1**: Image showing UV map of two overlapped triangles and sampled texture with same UV coords

Here are the sources for those images, please do not overwrite the sources.

* [Demo](http://webglplayground.net/saved/CZTXXQeZFH) showing the UV map
* [Demo](http://webglplayground.net/saved/tTnh7zvUc6) showing the texture


---

