O'Reilly logo

Mastering Unity Shaders and Effects by Jamie Dean

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

Writing a simple mobile shader

Mobile shaders tend to be more efficient—ready to be run with fewer and smaller textures for a reduced screen size.

Unity comes with quite a few Mobile shaders ready to be used in a project. Unlike the Standard shaders, mobile shaders are not automatically optimized, so they need to include the exact inputs and features that you want to use in a material.

One shader that is missing is a Mobile Diffuse Specular shader. We can write this shader and compare it in our mobile build:

  1. In the Project panel, select the PACKT_Shaders folder to view its contents in the Assets panel.
  2. In an empty area of the Assets panel, create a new shader asset. Right-click and choose Create | Shader | Standard Surface Shader.

    A new shader will ...

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