Sorry if this is basic, but I'm trying to randomly assign/shift the UV coordinates of a single wood material on approx. 125 separate planks/panels in a wall so that there are no repeating patterns. This is an imported model, so I can't use an Octane Scatter object or a MoGraph object (I've tried a Fracture object, but I couldn't get a result).
Can someone point me in the right direction?
Random shifting of texture UV coordinates?
Moderators: ChrisHekman, aoktar
Osl is the right way to look.
Octane For Cinema 4D developer / 3d generalist
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
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.
viewtopic.php?f=73&t=69211
You 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.
With this one you can mask individual objects based on ID. You will see that InstanceIDs mach Index numbers exactly.
Cheers
Milan
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.
viewtopic.php?f=73&t=69211
You 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);
}
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;
}
Milan
Colorist / VFX artist / Motion Designer
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
Big thanks Milan for sharing the RandomInstanceColor.osl node
I have updated my post here with .orbx and .c4d example files.
Happy GPU Rendering,
ciao Beppe

I have updated my post here with .orbx and .c4d example files.
Happy GPU Rendering,
ciao Beppe