9
$\begingroup$

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

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 ?

$\endgroup$

1 Answer 1

8
$\begingroup$

What you see in the image called a UV map. 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

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 showing the UV map
  • Demo showing the texture
$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.