Materials, textures, and shaders

In Chapter 3, Cardboard Box, we introduced the OpenGL ES 2.0 graphics pipeline and simple shaders. We will now extract that code into a separate Material class.

In computer graphics, materials refer to the visual surface characteristics of geometric models. When rendering an object in the scene, materials are used together with lighting and other scene information required by the shader code and the OpenGL graphics pipeline.

A solid colored material is the simplest; the entire surface of the object is a single color. Any color variation in the final rendering will be due to lighting, shadows, and other features in a different shader variant. It is quite possible to produce solid color materials with lighting and ...

Get Cardboard VR Projects for Android now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.