Lab 2: Getting Started with WebGL
- In lab, we will look at the basic anatomy of a Simple WebGL Program.
- Set up html5 rendering canvas
- Set up WebGL rendering context
- Generate geometry data
- Create buffer objects and load geometry data into them
- Create shader programs (vertex & fragment)
- Setup connection between data locations and shader variables
- render (draw) the scene
-
What is WebGL?
-
General 3D Rendering Methods:
-
At a high level, how are 3D images created (i.e. rendered)?
-
Simple Pipeline and WebGL
A little more about GPUs and shaders:
- Hardware View
- Why use the GPU? GPU vs CPU
- The vertex and fragment calculations are actually performed on the GPU by running
small programs called shaders. There are various types of shaders. We
will only be using vertex and fragment shaders.
- In addition to WebGL/Javascript, you must also
write shader code using the OpenGL Shading Language (GLSL).
-
References