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

Use of color in the scene

It is time to discuss transparency and alpha blending. We mentioned before that the alpha channel can carry information about the opacity of the color with which the object is being painted. However, as we saw in the cube example, it is not possible to obtain a translucent object unless alpha blending is activated. Things get a bit more complicated when we have several objects in the scene. We will see here what to do in order to have a consistent scene when we have translucent and opaque objects.

Transparency

The first approach to obtain transparent objects is to use polygon stippling. This technique consists of discarding some fragments so you can see through the object. Think of it as punching little holes throughout ...

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