Page 8-3 - Texture Notes

# Page 8-3 - Texture Notes

This page are some notes about texturing. The notes are meant to remind you about what you've learned in class and point you towards resources to learn more from. This is not a texture tutorial

## Box 1: The Big Picture

Texturing is a way to add details to a scene without making the geometry more complex. Effectively, it provides a way to make a decision about appearance for every pixel on the screen - without having to make triangles that are pixel sized.

The obvious catch is that we can't know the pixels ahead of time: a triangle may be big or small on the screen. We need to define the textures in a way that is independent of the actual pixels, and then compute the texture for each pixel.

This means that texturing has two main parts: texture coordinates where we assign places on an object some coordinate system that can be used for determining appearance, in a way that when the object is drawn each pixel can know what its coordinates are; and texture lookup to determine the appearance for each pixel when the triangle is drawn.

For both texture coordinates and texture lookup, there are many ways to do things. For now, we will use the most common case because it will allow us to make fancy looking objects easily. Later, we'll learn the details of how textures work, and see fancier kinds of textures.

The specific kinds of textures we will consider will use: triangle coordinates for the texture coordinates, and image lookup for the texture lookup. Effectively, this will allow us to paste pictures (images) onto triangles (or groups of triangles)

You may want to review the difference between an image and an object from Tutorial: Image vs. Object (raster vs. vector).

## Box 2: The Key Concepts

The key concepts we learned about in class (Tuesday April 2nd):

• The idea of texture coordinates
• Why we need triangle coordinates, and the idea of UV coordinates on triangles
• The idea of image based texture lookup
• Why we need filtering for texture lookups

You might want to review this in a textbook. Fundamentals of Computer Graphics Chapter 11 (FCG4_Ch11.pdf) covers texturing, describing it in a very general way. Section 11.1 gives the main ideas, and 11.2 gives many different types of textures - we'll focus on what's described in 12.2.2. Sections 11.2.4 (perspective correct interpolation) and 11.3 (pixel lookups) are topics we will come back to.

## Box 3: Image-Based, Triangle Interpolated Textures, for Color Maps

The specific kind of textures we're doing are:

1. Triangle coordinate interpolation (for texture coordinates): We'll put UV values on each vertex of the triangle. The system will interpolate these values for each pixel.
2. Image-Based Texture Lookup: Given the u,v coordinate for a pixel, we'll look up its value in an image.
3. Color Maps: we'll use the value we looked up in the image as the color for the pixel. We may use this as the material color (so it is affected by lighting), or we might just use the color directly (so it won't be affected by lighting).

## Box 4: Coming Attractions

For each of the choices in the previous box, there are lots of other choices, and lots of details to consider. With THREE, we don't need to worry about the details: it will make reasonable choices for us. In the future, we will want more control over these choices, and we'll want to try different kinds of texturing.

1. Coordinates: we'll see different ways to determine texture coordinates in order to make solid materials (like wood and stone) or to achieve fancy effects like reflection.
2. Texture Lookup: we'll see how the image lookup process can cause problems, and how we can control the process to get better quality. We'll also look at alternatives to using pre-defined images (procedural textures).
3. Texture Use: rather than controlling the color, we can control other aspects of the appearance. We'll look at adjusting material properties, apparent shape, lighting, ...

## Summary: Texturing

This page should give you a reminder of what you've learned about texturing so far. On the next page, we'll review how this is applied in THREE.