Last class, we learned how to texture our 3D materials. We talked about bump mapping, displacement mapping, and other advanced methods to add textures.

Another approach that we can use is 3D Procedural Noise & Solid Modeling — essentially, taking a 3D object and projecting it onto a different object. This is useful when our texture isn't necessarily a 2D image (e.g. marble).

Today, we're going to cover how to do simple shading. In the simple method that we're going to cover, we typically have an artist that draws this shading, and we apply it in a similar method to texture mapping.

If we use ray tracing (and measure how light rays are bouncing around), that's called ambient occlusion. That approach can be quite computationally expensive, though.

If we use ray tracing (and measure how light rays are bouncing around), that's called ambient occlusion. That approach can be quite computationally expensive, though.

Another thing we can do is volumetric rendering. This is another way of texturing - we essentially sum up values by depth, and we can get a textured feel of depth.

Another thing we can do is volumetric rendering. This is another way of texturing - we essentially sum up values by depth, and we can get a textured feel of depth.


The Rasterization Pipeline

Now that we know how to place an image into 3D geometry, are we ready to draw things? So far, we've learned a couple of different things –

Here's what we've learned so far...

Here's what we've learned so far...

If we use everything that we've learned so far, here's what we get. What's happening is that the blue cube is always in the front, so we get this weird effect. The order is not properly maintained. Regardless of where these objects are in 3D space, we're just rendering things one-by-one into our frame buffer, resulting in this.

If we use everything that we've learned so far, here's what we get. What's happening is that the blue cube is always in the front, so we get this weird effect. The order is not properly maintained. Regardless of where these objects are in 3D space, we're just rendering things one-by-one into our frame buffer, resulting in this.

Here's what we want to see. Notice how it's easy to tell depth from these, and we've also added some shading on these boxes that helps us differ between them.

Here's what we want to see. Notice how it's easy to tell depth from these, and we've also added some shading on these boxes that helps us differ between them.

What else are we missing?

  1. Surface Representations - objects in the real world exhibit highly complex geometric details.
  2. Lighting & Materials - appearance is a result of how light sources reflect off complex materials.
  3. Camera Models - real lenses create images with focusing and other optical effects.

Today, we're going to talk about visibility, shading, and the overall pipeline.

Today, we're going to talk about visibility, shading, and the overall pipeline.


Visibility

We're going to start with the idea of visibility. Recall our cubes (the rotating ones) - there's some transformation happening to each cube. The problem with our cubes is that we just draw them in some arbitrary order — and overwrite things that are closer with things that are farther away, based on what happens to be drawn first/last on the frame buffer.

Painter's Algorithm