O'Reilly logo

Unity Shaders and Effects Cookbook by Kenny Lammers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using vertex color for terrains

One of the most common uses of vertex information is by creating more realistic-looking terrains or environments. This is done by using each channel of the RGBA vertex color to blend into different textures. This is very efficient since you don't have to import yet another texture to blend into the other textures. You'll see this technique in just about every game that deals with outdoor terrains and structures.

This particular recipe will demonstrate a more advanced way of performing this blend by using a grayscale image or heightmap to add more detail to the vertex blending.

Getting ready

Let's take a moment to get our scene together and gather a few textures we will need:

  1. Create a new scene and import a mesh from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required