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: 

Texturing XYZ Multi-Channel map workflow

6 REPLIES 6
Reply
Message 1 of 7
vivabeta
2237 Views, 6 Replies

Texturing XYZ Multi-Channel map workflow

screen-shot-2019-09-24-at-123647-pm.png6575b1e2c51f81d2020edd282263f428.gifHello all, I was wondering if anyone could help me with the proper workflow for using the Texturing XYZ multi-channel maps alongside a displacement map from ZBrush. The XYZ MC image combines three levels of detail, one in each RGB channel, and the ZBrush map is greyscale. I've seen tutorials where the channels in Maya are split using a plusMinusAverage node, which doesn't exist in C4D.

Thanks in advance.

Tags (1)
Labels (1)
6 REPLIES 6
Message 2 of 7
madsd
in reply to: vivabeta

Give me some hours, I am doing something, but I can write you this plusminusaverage node in OSL.

Message 3 of 7
madsd
in reply to: vivabeta

Attached 3 custom osl shaders that attempts to honor your screenshot.
I have not tested it, I just wrote it directly but it should work? Let me know.
The nodes have both plus minus and average build in.
Note in OSL we cannot detect if a node is plugged in so you need to add the number of inputs and an integer.

I did not write a single generic plusminus average node, just attempt to solve your specific node rig, OFC we can modify and extend these nodes like we want. But it should give you a head start.

4629-qwe.jpg

4630-qweqwe.jpg

This is what the most right node looks like.

shader MOSTRIGHT_NODE
(
	 string Mode = "Plus"
  	[[ string widget="popup", string options = "Plus|Minus|Average",
  	   string label="Mode",
  	   string help="Pick a mode Plus, Minus, Average" ]],
vector Input3D_0 = 0,
vector Input3D_1 = 0,
vector Input3D_2 = 0,
int inputs = 3,
output float Out_3Dx = 0,
)
{	vector tmp;
	if(Mode == "Plus")
	tmp = Input3D_0+Input3D_1+Input3D_2;
	if(Mode == "Minus")
	tmp = Input3D_0-Input3D_1-Input3D_2;
	if(Mode == "Average")
	tmp = Input3D_0+Input3D_1+Input3D_2/inputs;
 Out_3Dx = tmp[0];
}
Message 4 of 7
vivabeta
in reply to: vivabeta

Awesome thanks Mads! I'll try this out tonight.

Message 5 of 7
vivabeta
in reply to: vivabeta

Mads! It's working but I think the displacement is making the model a little puffy as the base grey level is either above or below 50%. I guess in the the plusMinusAverage node there's an option to do something like this with setting one of the 3D inputs to -0.5 (or whatever level necessary) to set the greyscale. Is it possible to write this into the OSL nodes? They're just for the 2 nodes on the left before they go into the multiply nodes. I attached a screengrab of the Maya plusMinusAverage.

screen-shot-2019-09-27-at-12435-am.png

Thanks again and this has been an enormous help so far!

Message 6 of 7
madsd
in reply to: vivabeta

I'm not entirely sure how that vector is hooked up to the input, I would assume it's an addition to the actual input 3D[0] for example.
If that is the case, you can actually also use a subtract node and subtract vector map ( 3 values ) from your input.
I attempt to include here, you can see I created 3 new vectors, a,b and c. adding up the original input and the bias input. so if you type in -0.5 it should lower the - other value.

4655-eee.jpg


Let me know if I broke it.

shader MOSTRIGHT_NODE
(
     string Mode = "Plus"
      [[ string widget="popup", string options = "Plus|Minus|Average",
         string label="Mode",
         string help="Pick a mode Plus, Minus, Average" ]],
vector i3D_0 = 0,
vector B_0 = vector(-.5),  
vector i3D_1 = 0,
vector B_1 = 0,
vector i3D_2 = 0,
vector B_2 = 0,
int inputs = 3,
output float Out_3Dx = 0,
)
{   
		vector a = i3D_0+B_0;
		vector b = i3D_1+B_1;
		vector c = i3D_2+B_2;
    vector tmp;
    if(Mode == "Plus")
    tmp = a+b+c;
    if(Mode == "Minus")
    tmp = a-b-c;
    if(Mode == "Average")
    tmp = a+b+c/inputs;
 Out_3Dx = tmp[0];
}
Message 7 of 7
vivabeta
in reply to: vivabeta

That's so rad. I'll check this out later.

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

Post to forums  

Autodesk Design & Make Report