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

Rendering to an offscreen framebuffer

In order to perform object selection using the offscreen framebuffer, this one has to be synchronized with the onscreen default framebuffer every time that this last one receives an update. If the onscreen framebuffer and the offscreen framebuffer were not synchronized, then we could be missing addition or deletion of objects, or updates in the camera position between buffers. As a result of it there would not be a correspondence.

A lack of correspondence will hinder us from reading the picking colors from the offscreen framebuffer and use them to identify the objects in the scene. We can also refer to picking colors as object labels.

To implement this synchronicity, we will create the render function. This ...

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