Page 1 of 2

Blender 2.8 objectid color

Posted: Fri Nov 08, 2019 4:33 am
by Fox
The objectid is broken in volume node, in material node it works, but random color generation by objectid does not work for volume absorption.
Both Blender ui and LuxCore ui. All objects render with same random color that is always red on all Blender material preview models too.

Re: Blender 2.8 objectid color

Posted: Fri Nov 08, 2019 9:18 am
by Egert_Kanep
Has it worked before? Maybe it is a limitation of object id color

Re: Blender 2.8 objectid color

Posted: Fri Nov 08, 2019 10:29 am
by Dade
Object ID is used only for materials (i.e. surfaces), not volumes.

Internally, in LuxCore, volumes are a special kind of materials but the Object ID is just not used. The problem probably arise from there, the field may have been unintentionally exposed in Blender.

Re: Blender 2.8 objectid color

Posted: Fri Nov 08, 2019 2:06 pm
by Fox
I just copy pasted it from material node, it wasn't exposed. Would it be possible to add this feature?

Re: Blender 2.8 objectid color

Posted: Fri Nov 08, 2019 3:16 pm
by Dade
Fox wrote: Fri Nov 08, 2019 2:06 pm I just copy pasted it from material node, it wasn't exposed. Would it be possible to add this feature?
Yes, it should be, let me check.

Re: Blender 2.8 objectid color

Posted: Sat Nov 09, 2019 2:51 pm
by Dade
Fox wrote: Fri Nov 08, 2019 4:33 am The objectid is broken in volume node, in material node it works, but random color generation by objectid does not work for volume absorption.
I checked the code and I was a bit confused because you are talking of object ID while I'm pretty sure you mean material ID.

Material ID is already fully supported for volumes and this is how it works:

- it is used if there is scattering event (i.e. an intersection) like the material ID of a surface is used if there is an intersection.

It is not used if the volume only absorb some path light but doesn't scatter the path.

Re: Blender 2.8 objectid color

Posted: Sat Nov 09, 2019 3:51 pm
by Fox
I have the object id color as a scale for textures.
Color iD Sample.jpg
Here is the sample file where 2 objects should have 2 different colors by random object id.
When you in material panel connect texture to transmission slot, it works like in below:
material panel object id.jpg
Blend file
id color sample.7z
(105.11 KiB) Downloaded 142 times

Re: Blender 2.8 objectid color

Posted: Sun Nov 10, 2019 8:48 pm
by Fox
When i use UV image texture in volume node, it writes error message "2d texture not supported"
UV map is scaled to 0, so it can only have 1 constant color value from single coordinate on image texture for entire object. In object node it works, but not in volume.

Re: Blender 2.8 objectid color

Posted: Mon Nov 11, 2019 12:18 pm
by Dade
Fox wrote: Sat Nov 09, 2019 3:51 pm I have the object id color as a scale for textures.
A volume as no object associated so it is pointless to use Object ID texture: https://github.com/LuxCoreRender/LuxCor ... df.cpp#L98

The objectID field is always initialized with NULL_INDEX (i.e. 0xffffffff aka as white color) for a volume.

Re: Blender 2.8 objectid color

Posted: Mon Nov 11, 2019 9:22 pm
by Fox
Maybe then new 3d texture type "random constant color"