Blender 2.8 objectid color

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Blender 2.8 objectid color

Post 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.
User avatar
Egert_Kanep
Posts: 237
Joined: Tue Mar 13, 2018 10:34 am

Re: Blender 2.8 objectid color

Post by Egert_Kanep »

Has it worked before? Maybe it is a limitation of object id color
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Blender 2.8 objectid color

Post 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.
Support LuxCoreRender project with salts and bounties
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Blender 2.8 objectid color

Post by Fox »

I just copy pasted it from material node, it wasn't exposed. Would it be possible to add this feature?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Blender 2.8 objectid color

Post 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.
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Blender 2.8 objectid color

Post 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.
Support LuxCoreRender project with salts and bounties
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Blender 2.8 objectid color

Post 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 136 times
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Blender 2.8 objectid color

Post 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.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Blender 2.8 objectid color

Post 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.
Support LuxCoreRender project with salts and bounties
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Blender 2.8 objectid color

Post by Fox »

Maybe then new 3d texture type "random constant color"
Post Reply