How to overlay a noise to MtlX Ambientocclusion ?

   879   8   1
User Avatar
Member
72 posts
Joined: 6月 2020
オフライン
A common procedural Shading trick is to overlay a noise to an ambient occlusion to create a Dirt pass.

I tried doing it with the MtlX Ambientocclusion VOP node but it does not seem to work af all.Any clue on why? Will it be fixed in H21?
User Avatar
Member
2658 posts
Joined: 6月 2008
オフライン
This seems to work for me. Remember to convert the Ambient Occlusion to a color if you want to use it that way. It defaults to a float output.
Edited by Enivob - 2025年8月13日 08:56:45

Attachments:
Untitled-1.jpg (298.3 KB)

Using Houdini Indie 20.5
Windows 11 64GB Ryzen 16 core.
nVidia 3060RTX 12BG RAM.
User Avatar
Member
72 posts
Joined: 6月 2020
オフライン
Enivob
This seems to work for me. Remember to convert the Ambient Occlusion to a color if you want to use it that way. It defaults to a float output.


You are using the AO output as a mask, which is not what I am trying to do unfortunately.
Check my file please, none of the nodes that should work, work in the intended way.
The ramp does not change the AO falloff in any way, nor the mtlx Overlay node does what Overlay should do.
The overlay node works fine when the inputs are 2 noises though.
Is this a bug? AO manipulation is very useful for good procedural dirt maps.
It seems you can not use any of the Mtlx Nodes to make to manipulate the output of the AO itself, except invert it and change the colors. It is not possible to transform the falloff and remap it to a multicolor ramp like "Twilight" for instance.. it will only chabge the beginning and the end colors.
Is it being fixed in H21?
Image Not Found
Edited by PaoloGiandoso - 2025年8月16日 18:42:21

Attachments:
Test_Overlay.jpg (2.0 MB)
Test.hipnc (202.9 KB)

User Avatar
Member
2658 posts
Joined: 6月 2008
オフライン
I'm not actually using AO as a mask, I'm using AO as a color with noise as a mask. If you want me to review your file, please attach it.
Using Houdini Indie 20.5
Windows 11 64GB Ryzen 16 core.
nVidia 3060RTX 12BG RAM.
User Avatar
Member
72 posts
Joined: 6月 2020
オフライン
Enivob
I'm not actually using AO as a mask, I'm using AO as a color with noise as a mask. If you want me to review your file, please attach it.
Yes you are right! Still not what I am trying to do unfortunately, as the overlay blend mode behave differently from a mask if my understanding of the math beyond it is correct.
Apologies, I thought I had uploaded the file before.
Here it is, attached below.


In the Material Builder shader you'll see that the very same chain of nodes that work on a regular noise:
- a contrast node to make the gradient punchier
- a ramp to remap it to an inferno
- an overlay node to overlay a 3d noise over it.

do not work when applied to a mtlx AO node. Which is weird because they are both a gradient from black to white.
Edited by PaoloGiandoso - 2025年8月16日 19:11:59

Attachments:
Test.hipnc (203.5 KB)
Test_Overlay.jpg (310.9 KB)

User Avatar
Member
2658 posts
Joined: 6月 2008
オフライン
You might want to try matching the ranges before routing the values into the ramp. AO has a range of 0-1, Noise has a range of -1 to 1. Try dropping down a mtlxRange node and remapping both inputs to 0-1. Remap is a better approach to establishing baseline ranges rather than guessing with contrast. Once I did that, I saw noise in the AO render.

Attachments:
ao_noise.gif (1.2 MB)

Using Houdini Indie 20.5
Windows 11 64GB Ryzen 16 core.
nVidia 3060RTX 12BG RAM.
User Avatar
Member
72 posts
Joined: 6月 2020
オフライン
Enivob
You might want to try matching the ranges before routing the values into the ramp. AO has a range of 0-1, Noise has a range of -1 to 1. Try dropping down a mtlxRange node and remapping both inputs to 0-1. Remap is a better approach to establishing baseline ranges rather than guessing with contrast. Once I did that, I saw noise in the AO render.
Hi
Thanks for the advice.
I tried that but I see no results. I linked my file below.
If you see the ramp is only applied to the AO.. And it is not changing the gradient of the AO to Inferno, it keeps it just a black to white gradient, skipping all the red to orange to yellow inbetween steps.
PS: The switch is just to compare the same node chain applied to the AO and then to a random gradient. For all intents the switch should stay on 0.
Edited by PaoloGiandoso - 2025年8月17日 14:23:54

Attachments:
Test.hipnc (220.5 KB)

User Avatar
Member
72 posts
Joined: 6月 2020
オフライン
Logged as bug 149017.
Edited by PaoloGiandoso - 2025年8月23日 09:16:58
User Avatar
Member
72 posts
Joined: 6月 2020
オフライン
I got an answer from the SideFX team.

SideFX Support Ticket: #169126

Hello

From our developers:

Hi. The thing about Mtlx AO VOP is that it only casts 1 occlusion ray, so the resulting value is only ever 0 or 1. So when mapping the output using ramp, it will only ever output values at the beginning and end of the ramp, and never values in-between.
You could use VEX material builder with Occlusion VOP with more than 1 sample to get in-between results which can be mapped to ramp, but please beware that this isn't available under karma XPU.

I am told that its in talks internally. Switching to RFE.
  • Quick Links