How it works...

The Emission property is reflective of the light that an object receives. If the Emission is white it will be fully lit with that color. If black, it will act as if it doesn't exist. We make use of that by using black by default. However, if we do put our mouse over the object, the OnMouseOver function will trigger, causing it to use the color mentioned.

I could write much more on the subject of Shader Graph, but, unfortunately, there isn't enough space in the book. If you would like to explore Shader Graph even more, Andy Touch has put together a lovely group of examples of Shader Graph being used that could be great research material. Check it out at https://github.com/UnityTechnologies/ShaderGraph_ExampleLibrary.

Get Unity 2018 Shaders and Effects Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.