Code Downloads & Errata

If you have purchased a Packt book and/or video, you can use this page to
  • Download the code or support files
  • View errata and amendments
  • Send us feedback

You selected

Unity 5.x Shaders and Effects Cookbook

Alan Zucconi

Published 2016-02-26


Please register your e-mail address to download files. We will e-mail you with a direct link to the code download. If you have bought this book, you can login to your account and download the code files from your account page.

Before downloading the files please tell us where you purchased this book.


- 6 submitted: last submission 07 Sep 2017

The correct screenshot after completing all the steps, in How to do it… section of Adding properties to a shader recipe of Chapter 1 can be downloaded from the following link:

Errata Type: Code | Page 33 ad 34

For the properties _ScrollXSpeed and _ScrollYSpeed, Assume they are in units per second, but when we calculate the xScrollValue and the yScrollValue, we multiply them by _Time (Or _Time.x).

In Unity's docs however, _Time.x = t/20, while _Time.y = t.
To have a correct speed per second, we should write :
fixed xScrollValue = _ScrollXSpeed * _Time.y;
fixed yScrollValue = _ScrollYSpeed * _Time.y;

Errata type: Code l Page no: 123

This:vertInput very(vertexInput v)

Should be: vertOutput vert(vertInput v)

Errata Type: Typo | Chapter 2 | Page 45

It is: the name of the surface output structure should be changed accordingly to SurfaeOutput instead of SurfaceOutputStandard:

Should be: the name of the surface output structure should be changed accordingly to SurfaceOutput instead of SurfaceOutputStandard:

Errata type: Code l Page no: 32

This: _ScrollXSpeed ("X Scroll Speed", "Range(0,10)) = 2
_ScrollYSpeed ("Y Scroll Speed", "Range(0,10)) = 2

Should be: _ScrollXSpeed ("X Scroll Speed", Range(0,10)) = 2
_ScrollYSpeed ("Y Scroll Speed", Range(0,10)) = 2

Errata type: Technical l Page no: 44

This: we should disable any lighting with nolighting

#pragma surface surf Lambert alpha:fade nolighting

Should be: we should disable any lighting with nolightmap

#pragma surface surf Lambert alpha:fade nolightmap