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

Creating transparent objects

We have seen that in order to create transparencies we need to:

  1. Enable alpha blending and select the interpolative blending function.
  2. Render the objects back-to-front.

How do we create transparent objects when there is nothing to blend them against? In other words, if there is only one object, how do we make it transparent?

One alternative to do this is to use face culling.

Face culling allows rendering the back face or the front face of an object only. You saw this in the previous Time For Action section when we only rendered the front face by enabling the Back Face Culling button.

Let's use the color cube that we used earlier in the chapter. We are going to make it transparent. For that effect, we will:

  1. Enable alpha blending ...

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