Lecture: Atoms
Dear students:
Textures are not just for colors. They effectively provide any kind of per-fragment data that we might need, with the understanding that we don't exactly know how many fragments are going to be rendered. This fragment data will necessarily be stretched across a surface. Today we'll use textures to achieve several effects: masking, billboards, and normal maps.
Billboard
To develop a visceral feel for what we're about to do in code, design your own billboard with a partner. Follow these steps:
- Draw two identical instances of a simple shape with a solid base, like a tree, saguaro cactus, fire hydrant, and so on.
- Cut out the shapes.
- Make a vertical cut at the bottom of one.
- Make a vertical cut at the top of the other.
- Interlock the two shapes along the cuts.
As you move your head to the side of one shape, the other is still fully visible.
Many Atoms
Let's now try rendering many atoms. We could create full sphere geometry and either draw it many times or pack the many vertices together into one VAO. Either way is expensive. An alternative is to use billboards. Let's try them by following these steps:
TODO
Here's your list of things to do before we meet next:
See you next time.
Sincerely,
P.S. It's time for a haiku!