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 colors on objects, lights, and on the scene in general. Specifically, we have learned that an object can be colored per vertex, per fragment, or it can have a constant color.

The color of light sources in the scene depends on implemented lighting model. Not all lights need to be always white. We have also seen how uniform arrays simplify working with multiple lights in ESSL and in JavaScript WebGL. Also we have created point directional lights.

The alpha value does not necessarily make an object translucent. Interpolative blending is necessary to create translucent objects. Also, the objects need to be rendered back-to-front.

Additionally, face culling can help to produce better results when there ...

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