Community
Arnold for 3ds Max
Rendering with Arnold in 3ds Max using the MaxtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Combine Vector with regular displacement

11 REPLIES 11
Reply
Message 1 of 12
Anonymous
1102 Views, 11 Replies

Combine Vector with regular displacement

I´m trying to translate this tutorial into Maya to combine a vector with a regular displacement but I am not finding the rgb to vector node so it seems I´m bit lost.
Anyone knows if in Maya is missing that node? Thanks

https://docs.arnoldrenderer.com/display/A5AFHUG/Combining+Regular+and+Vector+Displacement+Maps

Tags (1)
Labels (1)
11 REPLIES 11
Message 2 of 12
madsd
in reply to: Anonymous

The RGB to vector node is in the conversion folder highlighted to the left.
Do note that this node does not contribute with anything except changing data type from rgb to vector.

Vectors, Colors and in many cases points are the same thing, you can use vector to parse color data, I do it constantly in OSL. So adding that node does nothing, you can do it however.

I also wrote a small rgbtoVector node as seen here, to verify this, result is identical regardless of it being rgb or vector in this case.


So in reality, atleast in core Arnold and MAX, you can just plug the add node directly to the displacement slot and you are good to go.

Do note that in Houdini, you need to flip the Y on the vector map, in max, this is not required, so if you get a twisted up ear, try flip that bool in Maya.

5555-qweqwe.png

Message 3 of 12
madsd
in reply to: Anonymous



5559-vectordispmix.jpg


5558-vectordispmixear.jpg


// VectorDispMIX.osl
// 6.1.2020 Mads Drøschler
// based on https://docs.arnoldrenderer.com/display/A5AFHUG/Combining+Regular+and+Vector+Displacement+Maps
// License: Free

shader VectorDispMIX
(
point Pos = P,
color In = 0
[[
string label = "DetailMap"
]],
float scale2 = -0.8
[[
string label = "DispScale"
]],
string fileName = ""
[[
string widget = "filename"
]],
float scale = 75
[[
string label = "VectorDispHeight"
]],
int InvertY = 0
[[
string widget = "checkBox"
]],
output vector Out = 0,
)
{
point Po = Pos;

if (InvertY == 1 )
Po[1] = 1-Po[1];

vector Normal = transform("object",N)*scale2*In;

Out = texture(fileName,Po[0],1-Po[1]);
Out = vector(Out[0],Out[2],Out[1])*scale;
Out += Normal;
}


I simplified the experience to 3 nodes.
I could plop it all into 1, but this should be fine, then you dont need to speculate about setting it up, because the shader does it for you ~

Also added optional Flip Y switch in bottom of shader UI

Also added to Git ->
https://github.com/gkmotu/OSL-Shaders/blob/master/VectorDispMIX.osl


We may need to ask Rachid to make the .mtd UI file for Maya tho at some point.



Message 4 of 12
Anonymous
in reply to: Anonymous

Ey Mads, thanks a lot of the osl shader and explanation.

At the end, I plug the add node and it seems to work, I need to adjust the noise intensity. Another problem that I´m having is the result, it seems that the displacement is applied as bump rather than the regular displacement affecting the silhouette, with the cell noise is quite obvious.

We don´t have the rgb to vector node in the conversion menu in Maya, that is why I was asking. 😕

5550-ear-noise.jpg

5561-ear-cell.jpg

Message 5 of 12
madsd
in reply to: Anonymous

Im not entirely sure why you get those black spots, what kind of noise are you using? and in what mode?

I get this by using a regular OSL FLOAT output noise. Not some vector setting noise. The darks are because of shadows, not because the mesh turns the inside out.

5560-qwe.png


Can you try run this through your mesh, its a debug shader checking normals. if they are inverted or facing correct ( you can also use it to shade leafs realtime translucency and many other things.


https://github.com/gkmotu/ArnoldSceneConverterScripts3DSMAX/blob/master/Shaders/FrontBack.osl

Message 6 of 12
Anonymous
in reply to: Anonymous

Just edit mtoa.mtd file in "C:\Program Files\Autodesk\Arnold\maya2020\plug-ins"
search for [node rgb_to_vector]
change
maya.hide BOOL true
to
maya.hide BOOL false

Message 7 of 12
Anonymous
in reply to: Anonymous

ok, I think now that I´m doing something totally wrong. I remove the autobump from the displace settings and now it´s rendering only the vector ear, no noise, so it seems the blending isn´t working and I don´t know why.

I follow the tutorial here is my hypershade node5574-ear-vector.jpg

Message 8 of 12
madsd
in reply to: Anonymous

If you look at my OSL code. line 37, you see an "N" in there.
Your state vector is set to Ro ( Ray Origin) so you are sampling something, Not-Normal. which is the camera to point ray.

Change Ro to N.
( But use my OSL shader instead for an easier setup )

Line 37 makes it up for multiple Arnold nodes, so its more efficient, fills less, less error prone.

Message 9 of 12
Anonymous
in reply to: madsd

Hi Mads, thanks again, I tried again with your shader but I got some errors or maybe I don´t know how to plug the maps, also I would like to use the complex shader node because maybe I can add more than one displacement
I also tried to change to "N" but it isn´t working neither. When I changed it, the plane move up and the noise appear now, but is flat...anw I feel so stupid now...hahaha. I will try again at night
Thanks!

Message 10 of 12
madsd
in reply to: Anonymous

Here I build it from scratch, if you follow, it will be impossible to fail.

https://www.twitch.tv/videos/532748986

Message 11 of 12
Anonymous
in reply to: madsd

now is working, thanks a lot for the help Mads. checking the video that is exactly what I did at the morning but I figure out, in Maya there is also a vectorspace in the displacement node that you need to change otherwise won´t work, don´t ask me why...hahaha

Message 12 of 12
madsd
in reply to: Anonymous

OK, good you got it working

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

Post to forums  

Autodesk Design & Make Report