O'Reilly logo

OpenGL ES 3.0 Cookbook by Parminder Singh

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 multiple primitives with primitive restart

OpenGL ES 3.0 introduced a new feature called primitive restart, where multiple disconnected geometry primitives can be rendered using a single API. This feature uses a special marker in the vertex data or the index data to concatenate different geometries of the same drawing type into a single batch. The restart primitive feature executes on the GPU. Therefore, it eliminates the communication overhead per drawing call. This provides high-performance graphics by avoiding multiple drawing calls from CPU to GPU.

The recipe shows us how to use the primitive restart technique to render a cube using two sets of geometries, which are separated by a special marker.

Getting ready

The marker used by the ...

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