Mesh Colorer

It is a set of shaders and utilities for simple and effective customization of a large number of objects. It will help to paint parts of units in color of the player quickly. You can download a package in Unity Asset Store.

Description of shaders

The description of shaders included into a package is provided in this part. Each of shaders is available in 2 options: with use of the normals map and without it. Also you can look at an interactive example of shaders.

Shaders for coloring

Colored Bumped Diffuse

All shaders intended for coloring objects are based on simple Diffuse shader. They compute a simple Lambertian lighting model and inherit following block of parameters:

  • Main Color - color of lighting.
  • Base Map - base texture of object.
  • Normal Map - texture that simulates small surface details.

Additional parameters are intended for definition of parts of object which are exposed to coloring, and also for a choice of new color of these parts.

  • Additional Color R/G/B/A - new colors of object. Here can be specified any colors. They will color all symbolics of the player on a unit. In the alpha channel of color you can specify blend degree of object's texture with additional color.
  • Color Map - texture defining what parts of object will bear symbolics of the player. Each channel of this texture will be painted by the corresponding additional color.
  • Blend Range - blend degree of object's texture with additional color.

Shaders for coloring can be divided into 2 types: Colored and Mesh-Colored. Their only difference is covered in a way of transfer of color to a shader, Colored Diffuse takes color from material's parameter, instead Mesh-Colored takes it from color of mesh vertices. Thus, it is possible to get some multi-colored objects which share same material. And in aggregate with the CombineMeshes method it will allow to reduce quantity of Draw Calls even in the free Unity version. Example of how it works you can see on YouTube.

Ghost shader

Ghost Bumped Color

This shader will help you with creation of effect of a ghost which can be met in many other games. It is based on rim lighting technics and has the following parameters:

  • Emission Color - color which will be used at a lack of light falling on model.
  • Transparency - degree of closeness to edges of the ghost's visible part.
  • Alpha - it is multiplied by the calculated alpha channel.