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

Depth testing in OpenGL ES 3.0

Depth testing allows us to render the object in the order of distance from the viewer. Without depth testing the rendering of the objects is similar to the painter's algorithm on the device screen. It will render the object on first-come-first-draw basis. For example, if there are three different colored triangles rendered in the order of, say, red, green, and blue, then as per painter's algorithm, it draws red first, green second, and blue at last. The result will appear on the screen in an opposite order, with blue on the top, green in the middle, and red at the bottom. This type of rendering does not take the distance of the triangle objects from the camera into consideration. In real life, the object closer to ...

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