Community
Arnold for Houdini Forum
Rendering with Arnold in Houdini and Solaris using the HtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Shader Optimisation Questions

5 REPLIES 5
Reply
Message 1 of 6
MeyerAdrian
317 Views, 5 Replies

Shader Optimisation Questions

Hi,

I have some questions regarding Shader Optimisation in Arnold for complex Shaders.

(in my case I have a kind of UberShader with around 400 Nodes in HtoA, packed as an HDA)


1. A lot of the nodes ar actually mostly not actively used, but are "switch options" to allow different features of the Shader to be enabled form the HDA UI.
I used a lot of switch nodes in the hope, that everything in the switch inputs that is not the active input, is not computed, and thus performance neutral.
Is this the case, or do nodes in a Shader onnly not get computed if their node connections are actually disconnected?

2. Furthermore, if there is an option to say, blend in another texture with a mix node, I used a switch after the mix node to make sure when the mix node is set to 0 or 1, only the then only active input gets computed. Is this necessary, or is arnold smart enough to omit shader graphs before a mix node when set to full 0 or 1 (and in blend mode). Same question for MixRGBA and MixShader.

3. Material Layering. When having a complex layered Material with different properties in different parts of the object (blended with masks)... It's mostly possible to achieve the look and different shading properties with a single Arnold Standard Shader, but then with complex layered inputs, so lots of MixRGBA Nodes, Color Correct Nodes etc.
The other option is to make seperate Standard Surface Shaders with little less complex inputs and then using a MixShader or LayerShader Node at the end.

Here again, what generally tends to more effcient? I guess it also has to to a little bit of how smart the MixShader and LayerShader Nodes are, so the topic above. Does it mean, when layering Standard Surfaces, that they are basically all fully computed for each Shading Point, even if the blend value might be 0 or 1 in some areas.

4. Costly Nodes. Is there some source to get some insides of how "costly" different Arnold Shader nodes are? I heard that for instance the Noise Shader is very expensive (makes sense).
When dealing with things like Occlusion, Curvature or Noise, I suppose it is always more efficient to have "prebaked" geometry user data attribs when possible instead of using the procedural nodes, with cost of heavier geo and probably more memory cunsumption?

Would be really usefull to get a better understanding of these things for really heavy scenes.

Hopefully usefull for many people.


Thanks a lot!


Adrian

Labels (5)
5 REPLIES 5
Message 2 of 6
madsd
in reply to: MeyerAdrian

Not a reply to any of your questions directly, but have you evaluated the OSL initiative?

You can drop a ton of nodes since you can pack multiple features and make preset feature groups, quite easily, reducing your large node hirachy to a fraction while still having a switchboard connected.


In theory, we can pack all your nodes into 1, provided the underlaying mechanisms are supported in OSL atm.

Message 3 of 6
MeyerAdrian
in reply to: madsd

Sounds interesting.

Could you elaborate a bit more, not yet familiar with OSL and Arnold. (Though I know how to code (-; )

Sounds like there is some kind of Auto Converter that takes Arnold / HtoA Shader Nodes and Builds Auto OSL Code from that or semething?

Message 4 of 6
madsd
in reply to: MeyerAdrian

I don't think there is an auto converter in the host.

But you would want to start typing up stuff instead, I would say.
It's C type external functions defines includes.


Example of noodle converted to a single node below.

The noodle is basic functions, add, multiply, take a fraction of a float value

float fract( float x )
{
x-floor(x);
}

where a mix would be

float Mix_Amount = some_value;
float Mixer = mix(a,b,Mix_Amount);

7778-cc.png

Message 5 of 6
madsd
in reply to: MeyerAdrian

Also, you can host procedural home written noises in some type of general master shader, or have many, integrate a triplanar map directly, complex volumetric stuff.

Message 6 of 6
MeyerAdrian
in reply to: MeyerAdrian

Anyone else any thoughts on this?

Would be great.

Thanks

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

Post to forums  

Autodesk Design & Make Report