O'Reilly logo

Unity Shaders and Effects Cookbook by Kenny Lammers

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

Modifying your Shaders for mobile

Now that we have seen quite a broad set of techniques for making really optimized Shaders, let's take a look at writing a nice, high quality Shader targeted for a mobile device. It is actually quite easy to make a few adjustments to the Shaders we have written so that they run faster on a mobile device. This includes elements such as using the approxview or halfasview lighting function variables. We can also reduce the amount of textures we need and even apply better compression for the textures we are using. By the end of this section, we will have a nicely optimized, normal-mapped Specular Shader for use in our mobile games.

Getting ready

Before we begin, let's get a fresh new scene made up and fill it up with ...

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