Want to watch this Lesson?

Start a free 7-day trial today. It's quick - and you can cancel anytime.

Watch course trailer Get Started

Baking ID Maps in Blender for Substance

crew
  • Software:Blender 2.78  ·
  • Difficulty:Intermediate
Random Color OSL script by Renatogsousa:
#include "stdosl.h"

shader RandomColor(
    output color RandomColor=0)
{
    float Random=0;
    float R=0;
    float G=0;
    float B=0;
    getattribute("object:random", Random);
    R=trunc(Random*100.0)/100.0;
    G=trunc((Random*100.0-trunc(Random*100.0))*100.0)/100.0;
    B=trunc((Random*10000.0-trunc(Random*10000.0))*100.0)/100.0;
    RandomColor=color(R,G,B);
}