Material id color AOV
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
- Egert_Kanep
- Posts: 237
- Joined: Tue Mar 13, 2018 10:34 am
Material id color AOV
Is this feature going to be developed further? Right now it seems that color id's are assigned randomly and getting a mask out of it is not very clean. It would help if one could specify colors, better yet cryptomatte support . But it is definitely a feature I'd like to see improved.
Re: Material id color AOV
You can specify a material ID in the output node.
The color is formed like this:
The ID is 4 bytes long.
The lowest byte is taken as the red channel (in range 0 to 255), the next byte is used as green channel, and the next as blue.
The highest byte is ignored.
You can form any color like this, where r, g, b are values in range 0 to 255:
r + (g * 256) + (b * 65536)
So for example pure red would be:
255 + (0 * 256) + (0 * 65536) = 255 as material ID
Pure blue would be:
0 + (0 * 256) + (255 * 65536) = 16711680
In the old LuxBlend addon I had a UI where you could directly input colors and it would compute the necessary ID for it, this could be included in the new addon: https://bitbucket.org/luxrender/luxblen ... #lines-915
The color is formed like this:
The ID is 4 bytes long.
The lowest byte is taken as the red channel (in range 0 to 255), the next byte is used as green channel, and the next as blue.
The highest byte is ignored.
You can form any color like this, where r, g, b are values in range 0 to 255:
r + (g * 256) + (b * 65536)
So for example pure red would be:
255 + (0 * 256) + (0 * 65536) = 255 as material ID
Pure blue would be:
0 + (0 * 256) + (255 * 65536) = 16711680
In the old LuxBlend addon I had a UI where you could directly input colors and it would compute the necessary ID for it, this could be included in the new addon: https://bitbucket.org/luxrender/luxblen ... #lines-915
- FarbigeWelt
- Donor
- Posts: 1046
- Joined: Sun Jul 01, 2018 12:07 pm
- Location: Switzerland
- Contact:
Re: Material id color AOV
Hi B.Y.O.P.
What about the idea to use the highest bit to change brightness of defined color to get values in 32 bit range?
Should be possible with little adjustments of default color node.
Maybe define RGB 0 to 255 and ‚move‘ in 32 bit color range with brightness slider -127 to +127.
What about the idea to use the highest bit to change brightness of defined color to get values in 32 bit range?
Should be possible with little adjustments of default color node.
Maybe define RGB 0 to 255 and ‚move‘ in 32 bit color range with brightness slider -127 to +127.
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
MacBook Air with M1
Re: Material id color AOV
I don't really understand what you want to say, sorry.
Why do you need a 32 bit color from the material ID?
Why do you need a 32 bit color from the material ID?
- FarbigeWelt
- Donor
- Posts: 1046
- Joined: Sun Jul 01, 2018 12:07 pm
- Location: Switzerland
- Contact:
Re: Material id color AOV
First of all I do not like spoilingl one byte out of four (means 25% loss of possible information) even if does not count much compared with today's memory capacity.
Then I thought about the way one can adjust colors running Photoshop on 32 bit color depth. I used this option to set a bright spot as sun in a blue sky HDRI.
Next step would be to use material ID as color input for objects or vice a versa. If there were only 8 bit vailable per channel and one liked to define different shining objects, 8 bit is not much considering an eye's range of about 1e5 (day light). And then there might be rays with depth>8 bouncing around objects with 0.5 absorbance.
Sure there is a limitation, because all channels would be 'moved' with same factor. This means my idea does not increase channels' resolution but in my opinion brightness is in the given example more relevant; also eyes are less capable to differentiate colors.
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
MacBook Air with M1
Re: Material id color AOV
If you just need distinct material IDs, you have 0xfffffffe available.
@Dade yes, I linked such a solution in my post above (used in old LuxBlend).
@Dade yes, I linked such a solution in my post above (used in old LuxBlend).
- Egert_Kanep
- Posts: 237
- Joined: Tue Mar 13, 2018 10:34 am
Re: Material id color AOV
Thanks for explaining. Although doing it like this can be a bit uncomfortable, not a very standard way of defining color, if I may say so . Especially for new users. An additional color input would be great, it is good to have visual representation of what is happening within one's scene.B.Y.O.B. wrote: ↑Thu Oct 25, 2018 12:51 pm You can specify a material ID in the output node.
The color is formed like this:
The ID is 4 bytes long.
The lowest byte is taken as the red channel (in range 0 to 255), the next byte is used as green channel, and the next as blue.
The highest byte is ignored.
You can form any color like this, where r, g, b are values in range 0 to 255:
r + (g * 256) + (b * 65536)
So for example pure red would be:
255 + (0 * 256) + (0 * 65536) = 255 as material ID
Pure blue would be:
0 + (0 * 256) + (255 * 65536) = 16711680
if the material id color could be defined like this 255,255,0 it already would make things much clearer. then additional color node would not be needed.
Last edited by Egert_Kanep on Fri Oct 26, 2018 7:11 am, edited 1 time in total.
Re: Material id color AOV
Well, it's an ID after all.
Interpreting it as a color is more a side application.
Interpreting it as a color is more a side application.
- Egert_Kanep
- Posts: 237
- Joined: Tue Mar 13, 2018 10:34 am
Re: Material id color AOV
Maybe I am trying to use it for wrong purposes? The way I see how it could be used, is for generating masks, but for pulling clear mask I can only use pure rgb (which I can now do, YES!) but I was wondering what is developers idea with this aov, is it something more technical? Because I am kind of lost now, with all this ID stuff, does this serve another purpose?