Author Topic: Using Height Map as displacement in Maya with Arnold.  (Read 15689 times)

So I know how to hook up a displacement map in Arnold. But the midpoint is based on a gray value, so even areas that should have no displacement 'puff up' the model.  The answer is likely in the Alpha Scale and Alpha Offset, or the spread between them. But I'm not sure the correct, or consistently correct settings to use.  In Zbrush, you can generate a displacement map with the midpoint set to rgb 0,0,0, so it doesn't bump where there's no detail. How might I achieve the same results with a Height Map generated in SP..

Thanks,
B.

Hi,
I recommend to change the default connection and change some parameters:

- Connect the generated image (the file node of course) through its Alpha Out output into the Displacement shader.
- Turn on the Alpha is Luminance option and set the Color Space to Raw in the file node.
- Alpha offset: -0.5 (This shifts the mid value to 0).
- Set the Displacement scale as you like it (in the Displacement Shader).

Because the generated Height map is not a 32 bit/channel image and the substances internally are not necessarily generating Height maps in the same way, there isn’t always a perfect way.

Here are some tests:
Displacement value: 50, Alpha Offset: 0


Displacement value: 50, Alpha Offset: -0.5. The surface is where it should be.


Here is a version where the scale value is much greater. The surface is where it should be.
Displacement value: 200, Alpha Offset: -0.5


Don't forget:
In Maya the object scale need to be 1,1,1 for correct results!

By the way I recommend to use tga not png format.

Cheers, D
Last Edit: November 29, 2016, 11:19:59 am
I'm an Environment Artist and R&D Generalist at Digic Pictures

Hi,
I recommend to change the default connection and change some parameters:

- Connect the generated image (the file node of course) through its Alpha Out output into the Displacement shader.
- Turn on the Alpha is Luminance option and set the Color Space to Raw in the file node.
- Alpha offset: -0.5 (This shifts the mid value to 0).
- Set the Displacement scale as you like it (in the Displacement Shader).

Because the generated Height map is not a 32 bit/channel image and the substances internally are not necessarily generating Height maps in the same way, there isn’t always a perfect way.

Here are some tests:
Displacement value: 50, Alpha Offset: 0


Displacement value: 50, Alpha Offset: -0.5. The surface is where it should be.


Here is a version where the scale value is much greater. The surface is where it should be.
Displacement value: 200, Alpha Offset: -0.5


Don't forget:
In Maya the object scale need to be 1,1,1 for correct results!

By the way I recommend to use tga not png format.

Cheers, D

Awesome post! Very helpful.

Just out of curiosity why do you mention to use TGA over PNG?

Cheers,
wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Awesome post! Very helpful.

Just out of curiosity why do you mention to use TGA over PNG?

Cheers,
wes

Hi Wes,

PNG always use transparency not alpha channels. In Maya that's a problem.
Sometimes normal maps got transparency (I think it's a mistake by the users who created the .sbsar files with Substance Designer. You can't get correct results if that's the case). But if you choose tga, the transparency info goes to a seperate channel and you just simply not using it. :)

Easier to edit the textures if the transparency (or any other information) is on a separate channel.
That was the main problem between Substance Painter and Unity (Unity can't managed the alpha channel correctly - gamma correction problem - you had to do the gamma correction in post, to get the right results). Do you remember that post? :)

Cheers, D
Last Edit: November 29, 2016, 11:14:55 pm
I'm an Environment Artist and R&D Generalist at Digic Pictures

Awesome post! Very helpful.

Just out of curiosity why do you mention to use TGA over PNG?

Cheers,
wes

Hi Wes,

PNG always use transparency not alpha channels. In Maya that's a problem.
Sometimes normal maps got transparency (I think it's a mistake by the users who created the .sbsar files with Substance Designer. You can't get correct results if that's the case).

Easier to edit the textures if the transparency (or any other information) is on a separate channel.
That was the main problem between Substance Painter and Unity (Unity can't managed the alpha channel correctly - gamma correction problem - you had to do the gamma correction in post, to get the right results). Do you remember that post? :)

Cheers, D

Ah, yes I remember that post now : ) Thanks so much for the clarification! I greatly appreciate all of your help and knowledge.

Cheers,
Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

I think the alpha offset should be +0.5 not -0.5 because the exported map from substance painter is black in the alpha 0 value and in maya black means object must be pushed in so I think offset +0.5 will push the black to 0 value. And I tried it and it was working better than -0.5.

Out of curiosity, is it -0.5 or 0.5 then?
Isn't there a parameter in the displacement node to change the midpoint? Is it the same thing then modifying the texture's alpha offset?
I can not find a definitive answer on the official documentation.

Out of curiosity, is it -0.5 or 0.5 then?
Isn't there a parameter in the displacement node to change the midpoint? Is it the same thing then modifying the texture's alpha offset?
I can not find a definitive answer on the official documentation.


Really it's just math.
-0.5 Offset means:

texture 0 (black) = -0.5 (push in)
texture 0.5 (mid gray) = 0 (do nothing)
texture 1 (white) = 0.5 (push out)


Cheers, D
I'm an Environment Artist and R&D Generalist at Digic Pictures

Got it.
And I found out what is the equivalent parameter in the displacement node, it is the Scalar Zero Value.

Therefore there are 2 options to obtain the same thing:
Option A: In the texture2D node set the Alpha Offset to -0.5
Option B: in the displacementShader node change the Scalar Zero Value to 0.5

It’s the same thing but the Scalar Zero Value is not supported by the Viewport.

Wish they made it more clear in the Arnold  6 online guide.

Thanks Paulo. I'll see if we can make sure this is the same and perhaps update our documentation at least to be accurate.
Software Engineer, Integrations
Maya, 3ds Max and Core Libraries

Thanks Galen! :)
I found also the Normal map documentation quite confusing to be honest. Although maybe is not the right topic here.
Took a while here on the forum to wrap my head around it what to check and uncheck.
As far as I understood:

Normal maps can be exported in 2 formats: Open GL and DirectX
Maya works with OpenGL (normal direction +Y) .
Substance Painter defaults to using DirectX (normal direction -Y).
If your Substance Painter project is set to use DirectX normals and you export maps using the "Arnold 5" export preset, the normal map will be converted to OpenGL.
If your Substance Painter project is set to use DirectX normals and you export using the "Document channels + Normal + AO (No Alpha)" export preset, the normal will be exported in DirectX format.

In Arnold for Maya, in order to correctly display the normal, you will need to adjust the Arnold attributes as follows:

If you are using the bump2D node:

OpenGL normal map [exported using “Arnold 5” export preset] - Uncheck Flip R Channel and Flip G Channel
DirectX normal map [exported using “Document channels + Normal + AO (No Alpha)” export preset] - Uncheck Flip R Channel

If you are using the aiNormalMap node:

OpenGL normal map [exported using “Arnold 5” export preset] - do nothing
DirectX normal map [exported using “Document channels + Normal + AO (No Alpha)” export preset] -Check Flip Y Channel

Got it.
And I found out what is the equivalent parameter in the displacement node, it is the Scalar Zero Value.

Therefore there are 2 options to obtain the same thing:
Option A: In the texture2D node set the Alpha Offset to -0.5
Option B: in the displacementShader node change the Scalar Zero Value to 0.5

It’s the same thing but the Scalar Zero Value is not supported by the Viewport.

Wish they made it more clear in the Arnold  6 online guide.


Yep. That's why I suggested that way (how to use it), four years ago :) .
By the way, earlier the documentation was more precise.
Cheers, D

The current version of the Substance plug-in works correctly!
Last Edit: March 26, 2020, 04:11:50 pm
I'm an Environment Artist and R&D Generalist at Digic Pictures