Page 14: Appearance (colors)

Spring 2026 Sample Solution

In 2D, we gave things color, and that was the color the object appeared. The artist or designer might choose the color to match some real-world phenomena, but basically programs must choose the colors directly. Interactions between objects are limited (for example, a transparent object might be affected by the colors of the objects drawn before it).

In 3D, it’s more complicated. Here are two spheres. They look the same (nearly identical).

On the left, we have a sphere made of green stuff (in this case, it would be some non-shiny, slightly metallic material) lit by a white light from above. On the right is a white sphere lit by a green light. For any point in a picture, the color depends on the color of the object, the color of the light, and the geometry between the point and light (simplistically, the parts of the sphere facing the light get more light, so they appear brighter).

In the real world, the color that something appears depends on many things:

  1. The surface properties of the object. If we paint an object with blue paint, or make it out of shiny gold, that affects the color we see.
  2. The light that reaches the object. If a lot of white light hits a point, it will appear different than if a little bit of red light hits the object. The amount, the color, and the directionality of the light all matter.
  3. The geometry of the object. For example, if it faces the light source, it will get more light.
  4. Where we are looking from. Some lighting effects depend on where we look from: a mirror reflection is an obvious example. But any shiny reflection from a bright spot is a similar phenomenon.
  5. Other objects. Most light doesn’t come directly from a light source: it comes from being bounced off of other surfaces. Shadows and (mirror) reflections are the most obvious of these effects.

For computer graphics, we distinguish #5 from everything else. Real lighting requires considering many objects all at once; however, this is complicated and expensive (since we need to consider lots of objects). We often simplify things by talking in terms of local (or direct) lighting vs. global lighting.

  • With local appearance models, each point on each object is considered independently from all other objects. We may consider the camera and the light sources, but we do not consider other objects (or even other points on the same object).
  • With global appearance models, we consider many points when trying to determine the color of any one. This mimics the real world. In the extreme case, every point in the world might affect every other point (since light might bounce around from anywhere to anywhere else).

In class, we will focus on local appearance models. Traditionally, with “interactive” computer graphics, the methods are local, and we will use hacks to fake global effects.

Preview: Why Local Models

The need for local appearance models will become clearer when we understand how the hardware works to draw scenes efficiently. But basically, each pixel on each triangle is computed as a separate computation that doesn’t consider any other triangles (or even, any other pixels on the triangle).

Having each triangle (and pixel) be independent means that the hardware can process them in parallel. But it does mean that each coloring computation can only look at a limited amount of data. It cannot depend on the (potentially unbounded) set of other triangles.

In this workbook, we restrict ourselves to local models without some of the advanced features we will use in subsequent workbooks (to create fancier effects):

  • Each triangle has a single “material” (including color information) that determines how it responds to light.
  • When computing lighting, at a point, we consider only the light that comes directly from the light source. We do not consider if another object either reflects or blocks the light.

For now, that means each triangle will be a solid color (which might mean different parts of it appear differently if they get different light). We will not see lighting effects that depend on another object (so no shadows or inter-object reflections). In the future, we will relax these restrictions.

Lighting and Shading 101

The problem of figuring out what color a 3D object appears is often called “lighting” or “shading” in computer graphics.

Lighting computations have two parts: transport, which figures out what light gets to the point, and reflectance, which figures out the color that point appears given its material and the light it receives.

With local lighting, we simplify transport to be computations that consider just the light and the point.

Summary: Appearance

We are focusing on local appearance models. That means that the colors that something appears depend on the light sources, the material properties, and the geometry of the point relative to the light sources and camera.

Next: Page  15 - Lights