Let's cover an example showcasing the preceding concepts in action:
- Open the ch03_05_wall.html file in your browser. You will see something similar to the following screenshot:
- Open the ch03_05_wall.html file in a code editor.
- Go to the vertex shader. Make sure that you identify the attributes, uniforms, and varyings that are declared there.
- Go to the fragment shader. Notice that there are no attributes here, because attributes are exclusive to the vertex shader.
Vertex and Fragment Shaders
You can find these shaders inside the script tags with the appropriate ID names. For example, the vertex shader can be found inside <script id="vertex-shader" type="x-shader/x-vertex">.
You can find these shaders inside the script tags with the appropriate ID names. For example, the vertex shader can be found inside <script id="vertex-shader" type="x-shader/x-vertex">.
- Go to the init function. Verify that we are calling initProgram and initLights there.
- Go to initProgram. Make sure that you understand...