Community
Arnold for Cinema 4D Forum
Rendering with Arnold in CINEMA 4D using the C4DtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how can I extract color from texture

12 REPLIES 12
Reply
Message 1 of 13
guglielmo_natuzzi
619 Views, 12 Replies

how can I extract color from texture

Is there a simple way to extract color from a texture in orderr to use it as mask in a layer shader? I've serched the forum and web but I coudn't find a solution. Thanks

Tags (2)
Labels (2)
12 REPLIES 12
Message 2 of 13

Don't the blending_mode or alpha operations of the layer_RGBA get the effect that you want to achieve? What is the effect that you are trying to achieve?

Lee Griggs
Arnold rendering specialist
AUTODESK
Message 3 of 13

I’m using some jsplacement maps in order to simulate a motheboard. I’d like to isolate color from the texture in order to use as mask and apply different shader via layer shader.
Now I’m using photoshop to select color and create texture to use as mask. I was wondering if there is a simple way without using photoshop.
thanks again

Message 4 of 13

In Arnold I’ve tried with the ramp but I cannot achieve a perfect result.

I’ll post some images if needed.

Message 5 of 13

Yes, LayerRGBA should work for that.

Lee Griggs
Arnold rendering specialist
AUTODESK
Message 6 of 13

I know that layer shader is the correct way. I was asking about the possibility to create masks directly in Arnold without using photoshop.
thanks in advance

Message 7 of 13

The attached file explain what I'm trying o achieve in arnold. perhaps usin a ramp node in association with some others nodes.

JS-2-20210919102354-Seamless.jpgmask2rid.jpg

Message 8 of 13
madsd
in reply to: guglielmo_natuzzi

This is easily done if you can code a bit of OSL.
Filters can be extracted at any level, with any combination of levels of grey as a base.
You can use something like if statements to capture data.

if()

{}
else if
{}
else if 
Message 9 of 13

Thanks a lot for your reply. But I have any knowledge of the osl languages.
I thought there was an easiest way.
thx

Message 10 of 13

Here is what I get using layer_RGBA.operations.

1632145677517.png

Lee Griggs
Arnold rendering specialist
AUTODESK
Message 11 of 13

A step further.
thx a lot.
i’ll try this solution

Thanks again

Guglielmo

Message 12 of 13

I've tried the suggested workflow but I was not able to isolate and mask part of the texture based on the color.the blending mode you suggested is omogeneusly applied to the whole texture.

Where is mi mistake?

Thx

Message 13 of 13
Anonymous
in reply to: guglielmo_natuzzi

This would be extremely useful. There are lots of ways to generate color data, and few ways to PICK a color from the data and manipulate it specifically. This is pretty much how post works, but theres no reason not to have this functionality at the material level. Being able to procedurally or dynamically generate masks is more efficient use of time and optimizes hardware resources come render.


I'm also trying to crack this egg. I want to use cryptomatte or AIUtilities > Object/ObjectID outputs as masks to limit projections to spcific areas of a subject. Making multiple materials for various parts, or creating numerous RGB masks is a complete time sync when the data is right there!


We want to be able to hand it any image, color pick any RBG value, and the output results in a black and white mask. Color picking is important as its unrealistic to manually determine and enter every value when we want to use this functionality.


Absolute perfect implementation would be using a cryptomatte enumerator that just listed the objects and you can add or remove them from a mask set. This is how nuke interprets the data, I just want to use it way before comp.


Any help would be greatly appreciated!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report