Chapter 2. Rendering Geometry
WebGL renders objects following a "divide and conquer" approach. Complex polygons are decomposed into triangles, lines, and point primitives. Then, each geometric primitive is processed in parallel by the GPU through a series of steps, known as the rendering pipeline, in order to create the final scene that is displayed on the canvas.
The first step to use the rendering pipeline is to define geometric entities. In this chapter, we will take a look at how geometric entities are defined in WebGL.
In this chapter, we will:
Understand how WebGL defines and processes geometric information
Discuss the relevant API methods that relate to geometry manipulation
Examine why and how to use JavaScript Object Notation (JSON) to define, store, and load complex geometries
Continue our analysis of WebGL as a state machine and describe the attributes relevant to geometry manipulation that can be set and retrieved from the state machine
Experiment with creating and loading different...