Let's cover a simple example of coloring a geometry:
- Open the ch06_01_cube.html file using your browser. You will see a page similar to the following:
- In this exercise, we’re going to compare constant versus per-vertex coloring. Let's talk about the page's widgets:
- Lambert: When selected, it will include the Lambert coefficient in the calculation of the final color.
- Per Vertex: The two different coloring methods explained before: per-vertex or constant.
- Complex Cube: Loads a JSON object where the vertices are repeated with the goal of obtaining multiple normals and multiple colors per vertex. We will explain how this works later on.
- Alpha Value: This slider is mapped to the uAlpha float uniform in the vertex shader. uAlpha sets the alpha value for the vertex color.
- Disable the use of the Lambert coefficient by clicking...