material id

Discussion related to the Engine functionality, implementations and API.
pepe
Posts: 8
Joined: Wed Sep 12, 2018 1:18 pm

material id

Post by pepe » Wed Sep 12, 2018 1:47 pm

Hello, ... I am testing blendluxcore and material id channel did not behave as expected. I get only black for id 0 and white id -1 in both versions 2 and 2.1 alpha 3. I expect to get for id -1 a different color [as in tool tip]. Thanks.

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

Re: material id

Post by B.Y.O.B. » Wed Sep 12, 2018 2:27 pm

Blender shows values that are greater than 1 as white in the image editor.
Since most random material IDs will be something like 345459845, the whole image is usually white.

However, if you hover your mouse over the material ID pass, then press and hold left mouse button, the actual value will be shown on the bottom.
This way you can find out the randomly assigned ID.

You can extract the ID that you want with a Blender node in the compositor:
https://docs.blender.org/manual/en/dev/ ... _mask.html
Attachments
2018-09-12_16-27-03.png
Support LuxCoreRender project with salts and bounties

pepe
Posts: 8
Joined: Wed Sep 12, 2018 1:18 pm

Re: material id

Post by pepe » Wed Sep 12, 2018 5:13 pm

Thanks for answer.

OK. I save the Material ID channel as exr, loaded in GIMP play with levels and this is what I got. [black is what materials id is -1, shades of grey is what I assign as id 1,2,3 etc].

My pipline is to get the render image and a material color image to be able to easy select the material from the render in Photosop - kind of the old luxrender Material ID.

Is possible to get a simple color material channel?
Attachments
screen.png

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

Re: material id

Post by B.Y.O.B. » Wed Sep 12, 2018 6:18 pm

Can't you use the color picker with 0 tolerance in the image manipulation program?
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 1465
Joined: Mon Dec 04, 2017 8:36 pm

Re: material id

Post by Dade » Wed Sep 12, 2018 6:58 pm

Material mask AOV may be what are you looking for :?:
Support LuxCoreRender project with salts and bounties

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

Re: material id

Post by B.Y.O.B. » Wed Sep 12, 2018 7:55 pm

Dade wrote:
Wed Sep 12, 2018 6:58 pm
Material mask AOV may be what are you looking for :?:
Unfortunately this one is not yet available in the addon. :|
Support LuxCoreRender project with salts and bounties

pepe
Posts: 8
Joined: Wed Sep 12, 2018 1:18 pm

Re: material id

Post by pepe » Wed Sep 12, 2018 8:14 pm

I did further testing and I can't get random value for id -1, however I can get the value I introduce as id, the difficult part is that I can't see during the rendering which material does not have a value [rather than -1] and the image is not aliased [creating a unreal selection compare width the render image around the edges].

User avatar
Dade
Developer
Posts: 1465
Joined: Mon Dec 04, 2017 8:36 pm

Re: material id

Post by Dade » Wed Sep 12, 2018 9:43 pm

pepe wrote:
Wed Sep 12, 2018 8:14 pm
and the image is not aliased [creating a unreal selection compare width the render image around the edges].
Aliased selection is available only trough Material ID mask AOV where it is returned the mask of a single Material ID and the values are between [0.0, 1.0] (for obvious reasons, you can not anti-alias integer values with Material ID AOV).
Support LuxCoreRender project with salts and bounties

pepe
Posts: 8
Joined: Wed Sep 12, 2018 1:18 pm

Re: material id

Post by pepe » Wed Sep 12, 2018 10:33 pm

I was thinking to be able to have the same workflow as with vray - rendering a color image base on materials [basically every material having a flat color] and using this just for selection - having the image on a different layer in photosop or gimp - and the flat color image to be aliasing for accurate selection - see below.

If I have to change a little the materials [ let's say to make the main brick a little lighter] I don't have to rerender the hole image.

However the tool is there. LuxCoreRender with denoising is really good.

Thank you guys for answering.


Block.png

User avatar
Dade
Developer
Posts: 1465
Joined: Mon Dec 04, 2017 8:36 pm

Re: material id

Post by Dade » Wed Sep 12, 2018 11:36 pm

pepe wrote:
Wed Sep 12, 2018 10:33 pm
I was thinking to be able to have the same workflow as with vray - rendering a color image base on materials [basically every material having a flat color]
But the edge between two different materials will be a mix of the 2 flat colors (i.e. the anti-aliased edge). How can you work on that set of pixels ? The Photoshop/gimp pick tool will not handle correctly the edge :?:

LuxCore doesn't currently have such AOV but would be quite easy to add however I don't understand how it can be used for your task.
Support LuxCoreRender project with salts and bounties

Post Reply