Getting ready

In order to write this shader, we need to prepare a few assets.

In order to view the colors of a vertex, we need to have a model that has had color applied to its vertices. While you could use Unity to apply colors, you would have to write a tool to allow an individual to apply the colors or write some scripts to achieve the color application.

In the case of this recipe, you can use a 3D modeling tool such as Maya or Blender to apply the colors to our model. There is a model available in the example code provided with the book in the Chapter 06 | Models folder (VertexColorObject.fbx) that you can obtain at the book's Support page at https://www.packtpub.com/books/content/support.

The following steps will set us up to create ...

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.