Detail Without Triangles

How to 3D

Chapter 9: Textures

Detail Without Triangles

Picture a piece of toast. From afar, the toast looks like an ordinary golden rectangular prism. But up close we see that the surface is not perfectly flat or uniform in color. It's full of holes, fossils of the carbon dioxide bubbles generated by the yeast. To render convincing toast, we need to make these irregularities visible.

One way to add detail to a surface is to add more triangles. But this is costly. Models made of many small triangles are challenging to manipulate, just as sand is harder to build with than bricks. Adding triangles also slows down rendering. The more triangles we have, the more matrix multiplications, clipping, and perspective divisions we have to compute. To achieve fast rendering, we want fewer triangles.

A cheaper way to get detail is to paste an image on the surface of a mesh. The image might even be photo of some real toast. Putting an image on a model to give the appearance of detail is called texturing. The detail is an illusion; no triangles are actually added. The pixels of the texture, which are called texels, provide the detail at a much lower cost than extra triangles.

This renderer uses just 112 vertices to render a piece of low-poly toast:

Toggle the texture to see the simple underlying geometry.

In this chapter we explore the process of applying textures to models. By its end, you'll be able to answer the following questions:

For the time being, we'll use textures only as a source of fine-grained albedo. In a later chapter, we'll see how we can use texture to produce a variety of visual effects.

Reading Images →