O'Reilly logo

Mastering Oculus Rift Development by Jack Donovan

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

Changing the appearance of objects with shaders

So far, the graphical work that we've done has all been to do with how the entire scene is rendered. The material so far in this chapter has been relatively code-free and has largely depended on scene configuration. In this section, we'll delve more deeply into the code-oriented side of graphics programming and write a shader, which is essentially a custom set of instructions about how the GPU should render an individual object.

Before we start writing code, it will help to gain a basic understanding of what happens in a shader's execution, so we'll briefly go over the two main processing steps of a shader written in ShaderLab, Unity's shader syntax.

A quick overview of ShaderLab shaders

All ShaderLab ...

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