O'Reilly logo

WebGL Beginner's Guide by Brandon Jones, Diego Cantor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required