RGB-Mask Shader

Hey blenders!

At work we use Photoshop an After Effects for compositing our renderings.
We had the problem, that ist was not possible to use the object or material index of cycles.

To solve that problem I did a little workaround with a simple shader-setup as material overwrite.
You can find the shader here: https://github.com/biteworks/RGB-Mask-Shader

How to:

  • Download “RGB-Mask-Shader.blend” from the repository
  • Append the Material “RGB-Mask-Shader” to your scene file
  • Apply this shader to a hidden geometry
  • Create a second render layer in “Render layers” panel called “Mask-Layer”
  • Apply the “RGB-Mask-Shader” to the material overwrite and set samples for this layer to 100 samples
  • Select the geometry you want to be red/green/blue/black in the “Mask-Layer”
  • Go to the “Object panel”.
  • Under “Relations” you will find a “Pass Index” -> set it to 1 ®, 2 (G), 3(B) or 0 (black)

It only works per object, not per material!

At the moment I am working on a little add-on to make it easier to use the shader without appending it to the scene.

Have fun with this shader!