Hi pcoombes
Well, for some reason builtin RandomColor node is not "seeing" the instanceID numbers in a Fracture setup but OSL does.
Instance Range works too.
This great script from Beppe should do exactly what you need.
https://render.otoy.com/forum/viewtopic.php?f=73&t=69211You can use this instead of RandomColor node. It will work with Fracture + Explode segments. Or, for example, as an input in Gradient node (complex mode) to randomize (multi)textures.
- Code: Select all
#include <octane-oslintrin.h>
shader RandomInstanceColor(
int Seed=0,
output color c = 0)
{
c = noise("cell",_getinstanceid(),Seed);
}
With this one you can mask individual objects based on ID. You will see that InstanceIDs mach Index numbers exactly.
- Code: Select all
#include <octane-oslintrin.h>
shader InstanceID(
color A = 1, color B = 0,
int InstanceID = 0 [[int min=0, int slidermax=100]],
int Swap = 0 [[string widget = "checkBox"]],
output color c = 0)
{
color outA = A;
color outB = B;
if (Swap==1) { outA = B; outB = A; }
c = (InstanceID==_getinstanceid())? outA: outB;
}
Cheers
Milan