Object iD

Use this forum for general user support and related questions.
Post Reply
Fox
Posts: 279
Joined: Sat Mar 31, 2018 11:17 am

Object iD

Post by Fox » Sat May 04, 2019 4:12 pm

What is the object iD in node editor?
Is there way to feed band texture values randomly to objects?

User avatar
B.Y.O.B.
Developer
Developer
Posts: 2809
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Object iD

Post by B.Y.O.B. » Sat May 04, 2019 5:27 pm

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.
Attachments
object_id.jpg
object_id.blend
(108.73 KiB) Downloaded 14 times
Support LuxCoreRender project with salts and bounties

Fox
Posts: 279
Joined: Sat Mar 31, 2018 11:17 am

Re: Object iD

Post by Fox » Sat May 04, 2019 5:52 pm

This is so cool, i can use it for pool tiles, with some blender noise texture + band texture in between.

Fox
Posts: 279
Joined: Sat Mar 31, 2018 11:17 am

Re: Object iD

Post by Fox » Sun May 05, 2019 3:36 am

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.

User avatar
B.Y.O.B.
Developer
Developer
Posts: 2809
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Object iD

Post by B.Y.O.B. » Sun May 05, 2019 8:27 am

You only need the object ID if you want to use the same material on multiple objects, but still have variation between the objects.
Support LuxCoreRender project with salts and bounties

Fox
Posts: 279
Joined: Sat Mar 31, 2018 11:17 am

Re: Object iD

Post by Fox » Sun May 05, 2019 10:26 am

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

Fox
Posts: 279
Joined: Sat Mar 31, 2018 11:17 am

Re: Object iD

Post by Fox » Mon May 06, 2019 4:42 pm

I got it done with boolean modifier, the object id has now 28000 tiles in 3 material groups.
Pool tiles boolean mod.jpg

Post Reply