Solid geometries with holes

Most of the materials encountered in a game are solid, meaning that they don't allow light to pass through them. At the same time, many objects have a very complex (yet flat) geometry. Modeling leaves and grass with 3D objects is often overkilled. A more efficient approach is to use a quad (rectangle) with a leaf texture. While the leaf itself is solid, the rest of the texture should be fully transparent. If this is what you want, then perform the following steps:

  1. From the material's Inspector tab, set Rendering Mode to Cutout.
  2. Use the Alpha Cutoff slider to determine the cutoff threshold. All the pixels in the Albedo map with an alpha value equal to or less than Alpha Cutoff will be hidden.

The following image, ...

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.