CS559 Spring 2021 Sample Solution - Workbook 9
Written by CS559 course staff
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.
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).
Key concepts we learned about in class:
- 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. FCG4_Ch11.pdf (6.1mb) 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 11.2.2.
Image-Based, Triangle-Interpolated Textures, for Color Maps
The specific kind of textures we’re doing are:
- 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.
- Image-Based Texture Lookup: Given the u,v coordinate for a pixel, we’ll look up its value in an image.
- 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).
For each of the previous choices, 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.
- 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.
- 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).
- 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, etc.
This page should give you a reminder of what you’ve learned about texturing so far. On Page 4 (Textures in THREE), we’ll review how this is applied in THREE.