Brain Dump

Color Mapping

Tags
computer-graphics

Is a form of texture mapping.

The most common approach to color-mapping is inverse-mapping:

For a pixel in screen space (on the objects surface) find its pre-image (the pixel it maps to) in texture space. Entire [see page 11, [areas](COM3503-w05-textures-01)] in screen space can map to a single pixel in a texture.

This works by [see page 12, dividing] the texture into a 2D area with \((0,0)\) at the bottom-left and \((1,1)\) at the top-right. Then each vertex in the polygon mesh of the objects surface is [see page 13, given] a \((u,v)\) value. Lastly for each pixel in each polygon we draw we linearly interpolate a \((u,v)\) coordinate and then pick the corresponding pixel from the texture.

Note: The \((u,v)\) value for each vertex on the mesh is constant. Even as the objects shape changes (see [see page 24, here]) the texture position stay the same allowing you to get wavy affects.

Note: Mapping a texture onto a 3D mesh is generally the [see page 25, job of an artist]. They can unwrap a mesh into [see page 26, individual areas] that can be painted independently. They can also [see page 27, cut] the mesh surface onto different areas that're joined at seams.

Warn: uniform steps on the image plane [see page 17, do not] correspond to uniform steps along the edge.

Forward Mapping

The general approach to color-mapping is:

First forward mapping from our texture onto an intermediate surface and then inverse mapping from that intermediate surface onto our object. See [see page 28, [here](COM3503-w05-textures-01)].
  • The forward mapping stage maps from 2D to 3D and is AKA S-Mapping.
  • The mapping from there to the objects surfaces is known as O-mapping.

O-Mapping generally has us place our intermediate-object inside the object and then [see page 33, projecting] each pixel from our objects surface onto our intermediate-objects surface.

Warn: The [see page 34, kind] of intermediate surface we use can affect the quality of our mapping.

Special Effects

You can [see page 41, layer multiple textures] on top of each other and alter the ambience calculations of only one of them to change partial specular highlighting. This can let you make only part of a texture appear [see page 39, metallic].

Links to this note