Moving to 3D
The basic ideas we will be studying for much of the rest of the course are very
briefly introduced here. Details on all of this will be covered in class and in
other items on the InClass.html page from which we
just came.
- 3D Scene Modeling
- Basic OpenGL constructs we will use are the same:
- VAO/VBO geometry/attribute creation tools
- glUniform tools for per-primitive (uniform) attributes
- Primitive rendering API: glDrawArrays & glDrawElements
- Draw modes (GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, etc.)
- There are three important modeling tasks to address when we design a scene:
- Geometry modeling: create the geometry of the points and normal vectors
that define the surfaces and other elements in our 3D scene.
- Attribute modeling: define the attributes associated with
the vertices and primitives in our geometry. The OpenGL API treats vertex coordinates and normal
vectors exactly like any other attribute. That is why we have just one type of VBO for all per-vertex
attributes. Nevertheless, we discuss them separately here because they are conceptually different and
they are specified in very different ways.
Non-geometric attributes include "obvious" things like colors, material properties, and texture
coordinates as well as any sort of application-specific attribute you may want to associate and
visualize on your model. How about stresses on a beam? Temperatures across a heat sink? The list
goes on.
- The lighting environment. This often overlooked item is frequently the key
to a really good scene rendering. For now, however, we will deal with it in an extremely minimalist
fashion, returning to this topic later to treat it more in the depth it deserves.
- 3D Scene Rendering
- 3D View Generation (parameters specified on CPU; applied in vertex
shader):
- View orientation (new in 3D)
- Projections (generalization of compute2DScaleTrans)
- Lighting Models (Attributes specified on CPU; model implemented in fragment shader):
- Uses the 3D normal vectors mentioned above as well as other per-vertex and/or
per-primitive attributes.
- Visible Surface Determination (VSD; implemented in "black-box" portion of graphics
pipeline after the fragment shader completes)
- Interactive view and scene manipulation (implemented primarily in your code on the CPU):
- Mouse-based dynamic rotation, pan, zoom
- General animation
A quick
glimpse at the structure of the approach we will take in "defineModel" and
"render" (CPU) and in the vertex shader (GPU)
Our general plan will be to study each of these aspects of scene modeling and rendering in multiple passes.
We will study "101" versions that contain the material you will need to understand in order to
do project 2. We will then study "102" versions that will be required for project 3. Finally, we will
examine some of these and other techniques that support more advanced features, and you will implement some
of those in our final project 4.