ABSTRACT

This chapter is an introduction to shaders and lighting in Unity. It takes a quick look at the wide variety of built-in shaders. The chapter discusses direct and indirect lighting by experimenting with these features in the puzzle room. It explores the more advanced topic of raytracing. Lighting in Unity approximates how light behaves in the real world. Lighting can be performed in real time, or it may be precomputed, a process that is called baking, similar to the baking of navmeshes. Raytracing is an advanced and new feature for Unity, so we will simply look at some sample output and weigh the pros and cons of using raytracing. Raytracing is a high-end or nonexistent feature for most current platforms.