Mantra generating unnecessary displace geo
2486 4 2-
- DeepwellAT
- Member
- 21 posts
- Joined: Sept. 2018
- Offline
Hi all,
I noticed that Mantra goes though a phase of generating displaced geometry whenever a shader does any displacement.
So e.g. as soon as I turn on the "Enable Noise Displacement" option on the principled shader, Mantra goes through that phase before actually starting to render.
(Note: This phase is only noticeable if you have lots of polys!)
Now here's the issue: As soon as I combine two principled shaders with a layer mix node, Mantra goes through this phase no matter what! Even if both principled shaders have all their displacements turned off, Mantra still creates the displaced geometry (of course without then actually displacing anything), taking its time and using up memory...
This kinda makes mixing layers unusable if you have complex geometry!! (unless you don't care about render times and/or memory usage)
Am I missing something here?
J.
I noticed that Mantra goes though a phase of generating displaced geometry whenever a shader does any displacement.
So e.g. as soon as I turn on the "Enable Noise Displacement" option on the principled shader, Mantra goes through that phase before actually starting to render.
(Note: This phase is only noticeable if you have lots of polys!)
Now here's the issue: As soon as I combine two principled shaders with a layer mix node, Mantra goes through this phase no matter what! Even if both principled shaders have all their displacements turned off, Mantra still creates the displaced geometry (of course without then actually displacing anything), taking its time and using up memory...
This kinda makes mixing layers unusable if you have complex geometry!! (unless you don't care about render times and/or memory usage)
Am I missing something here?
J.
-
- jsmack
- Member
- 8237 posts
- Joined: Sept. 2011
- Offline
DeepwellVFX
Am I missing something here?
Add the render property 'shop_disable_displace_shader' to the material or with a properties node. The principled shader relies on this hidden property to disable displacement when unused. Layering shaders makes their render properties bypassed, as the last node in the chain, or a collected properties node, determines the properties instead.
-
- DeepwellAT
- Member
- 21 posts
- Joined: Sept. 2018
- Offline
Hey @jsmack,
great! Many thx!!
So when I'm creating my own material I just add a properties node and add the shop_disable_displace_shader - works like a charm!
Now, when I'm just chaining materials together with layer mix nodes, the last node in the chain is a layer mix node - on which I have no way of adding that property.
So I created an extra material builder node to put at the end of such chain (see screenshot), that simply adds the shader property and gets rid of all displacement.
It succeeds in making Mantra not enter the "Generating displacement geometry" phase - so that's good.
I'm just not sure if that is really the way to do it.
For example piping the properties node into the "shader2" input of the output collector strikes my as odd (that's usually where the displacement shader goes).
It also seems to do the job if I omit the properties node - probably because I'm not piping the displacement shader through anyway...
@ksmack Could I ask you to take a short look at it? Maybe it kinda works but I'm doing it wrong/awkwardly...
great! Many thx!!
So when I'm creating my own material I just add a properties node and add the shop_disable_displace_shader - works like a charm!
Now, when I'm just chaining materials together with layer mix nodes, the last node in the chain is a layer mix node - on which I have no way of adding that property.
So I created an extra material builder node to put at the end of such chain (see screenshot), that simply adds the shader property and gets rid of all displacement.
It succeeds in making Mantra not enter the "Generating displacement geometry" phase - so that's good.
I'm just not sure if that is really the way to do it.
For example piping the properties node into the "shader2" input of the output collector strikes my as odd (that's usually where the displacement shader goes).
It also seems to do the job if I omit the properties node - probably because I'm not piping the displacement shader through anyway...
@ksmack Could I ask you to take a short look at it? Maybe it kinda works but I'm doing it wrong/awkwardly...
Edited by DeepwellAT - Oct. 10, 2021 03:33:49
-
- jsmack
- Member
- 8237 posts
- Joined: Sept. 2011
- Offline
DeepwellVFX
Now, when I'm just chaining materials together with layer mix nodes, the last node in the chain is a layer mix node - on which I have no way of adding that property.
The last node in the chain should be a collect vop. Yes, you can assign any node as the material in mantra, but that means that Houdini is 'finishing' the rest of your material automatically. Building the shader out to the terminal explicitly gives more control.
DeepwellVFX
So I created an extra material builder node to put at the end of such chain (see screenshot), that simply adds the shader property and gets rid of all displacement.
It's not really wrong but may have undesired results, as the exports from the final material builder will actually be lost. It's preferred to put the layering inside the material builder instead.
Edited by jsmack - Oct. 9, 2021 19:03:54
-
- DeepwellAT
- Member
- 21 posts
- Joined: Sept. 2018
- Offline
Many thx for this clarification!
It's good to know the clean way of doing this.
As I want my node-set to be boiled down to the simplest possible use I will give it a try with my "KillDisplacement" material builder node to be simply plugged to the end of the chain, as having to put in the correct exports/outputs/properties/collect construct would be demanding too much of the potential user. But should I discover any undesirable sidefx (
) I know what to do now.
Thx again!
PS: I wonder if many people that are using the layer mixing stuff are aware of the fact that it will increase render time and memory usage by creating unnecessary geometry...
It's good to know the clean way of doing this.
As I want my node-set to be boiled down to the simplest possible use I will give it a try with my "KillDisplacement" material builder node to be simply plugged to the end of the chain, as having to put in the correct exports/outputs/properties/collect construct would be demanding too much of the potential user. But should I discover any undesirable sidefx (
) I know what to do now.Thx again!
PS: I wonder if many people that are using the layer mixing stuff are aware of the fact that it will increase render time and memory usage by creating unnecessary geometry...
-
- Quick Links

