Summary

In this chapter, we have seen how to use the vertex shader and the fragment shader to define a lighting model for our 3D scene. We have learned in detail what light sources, materials, and normals are, and how these elements interact to illuminate a WebGL scene. We have also learned the difference between a shading method and a lighting model and have studied the basic Goraud and Phong shading methods and the Lambertian and Phong lighting models. We have also seen several examples of how to implement these shading and lighting models in code using ESSL, and how to communicate between the WebGL code and the ESSL code through attributes and uniforms.

In the following chapter, we will expand on the use of matrices in ESSL and we will see how ...

Get WebGL Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.