How to do it...

As mentioned previously, there are a few aspects that we need to take care of while using a Transparent Shader:

  1. Remove the _Glossiness and _Metallic variables from the Properties and SubShader sections of the code as they aren't needed for this example.
  2. In the SubShader{} section of the shader, modify the Tags section to the following so that we can signal that the shader is transparent:
Tags 
{ 
  "Queue" = "Transparent" 
  "IgnoreProjector" = "True" 
  "RenderType" = "Transparent" 
} 

Tags are used by the SubShader to know how and when items should be rendered. Similar to the dictionary type, tags are key-value pairs where the left-hand side is the tag name and the right-hand side is the value you wish for it to be set to.

For more ...

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.