Page 1 of 1

Object iD

Posted: Sat May 04, 2019 4:12 pm
by Fox
What is the object iD in node editor?
Is there way to feed band texture values randomly to objects?

Re: Object iD

Posted: Sat May 04, 2019 5:27 pm
by B.Y.O.B.
It allows you to access the object ID in a material.
By default, object IDs are assigned by hashing the object name (so you get a seemingly random, but stable value). But you can also assign custom object IDs in the latest v2.2beta1 (in the object properties in Blender).
The object ID is a 4 byte unsigned int.

There are three modes:
- Color: the lower 3 bytes are interpreted as R, G, B values -> you get "random" colors
- Normalized: the returned value is in the range 0..1 -> you get "random" grayscale values
- Raw: you get the raw object ID (range 0..0xffffffff), this is for power users who want to do their own calculations
Fox wrote: Sat May 04, 2019 4:12 pm Is there way to feed band texture values randomly to objects?
You can plug the output of the "normalized" mode into a band texture input - is that what you mean?

Attached is a small example showing the three modes.

Re: Object iD

Posted: Sat May 04, 2019 5:52 pm
by Fox
This is so cool, i can use it for pool tiles, with some blender noise texture + band texture in between.

Re: Object iD

Posted: Sun May 05, 2019 3:36 am
by Fox
Aa i see now, to map object id's in the shape of some procedural texture is not possible.
I have the random colors with little texturing, the tiles look pretty good already as is.

Re: Object iD

Posted: Sun May 05, 2019 8:27 am
by B.Y.O.B.
You only need the object ID if you want to use the same material on multiple objects, but still have variation between the objects.

Re: Object iD

Posted: Sun May 05, 2019 10:26 am
by Fox
I can make 2 object/ material groups via visible selection through procedural displacement.
One white gray shade tiles.
Another blue shade tiles.

But the tiles would have to be little smaller.
2 groups for pool tiles.jpg

Re: Object iD

Posted: Mon May 06, 2019 4:42 pm
by Fox
I got it done with boolean modifier, the object id has now 28000 tiles in 3 material groups.
Pool tiles boolean mod.jpg