Community
Arnold General Rendering Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

aiCache node more information

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Slava_91
1159 Views, 2 Replies

aiCache node more information

Hi guys!
Anyone use the aiCache node? In which cases is it best to use it? in the documentation is not entirely intelligible is the essence of its appointment ... Will there be any increase if it is used at the end of a comlex shading nodes with textures? Does it perform the same role as the bake node in the mari node graph?
Sorry for my English
Thank you!

Tags (2)
Labels (2)
2 REPLIES 2
Message 2 of 3
Mike_Farnsworth
in reply to: Slava_91

The purpose of the built-in cache shading node is to stop a part of the shading network from being run multiple times during the course of shading a single intersection point. Arnold currently executes shader nodes based on a shader parameter being "asked for"; for example, in the standard_surface shader the base_color parameter is only evaluated if the base parameter is greater than zero. If the base_color parameter is connected to another shader (or a bunch of upstream shaders in a network), then those shader nodes are evaluated.

Now, imagine that same set of shader nodes connected to base_color are also connected to another parameter of a shader. If that parameter gets evaluated, Arnold will go evaluate that section of the shader network again. If those shader nodes are expensive (e.g. a bunch of noise nodes, etc), and they produce the same results each time, then that is duplicated and wasted computation.

The cache node can be used in these situations to avoid duplicated work in your shader network. If you connect that part of the shader network to a cache node, and then connect that to those same shader parameters, it will avoid doing that work more than once.

Note that the cache node is smart enough to realize a shader modified something, such as the position, ray origin, UVs, surface normal, etc and will not give a cached result in that case (because the upstream shaders will probably give a different result if one of those changes). Generally you don't need to worry about this, though.

So, the rule of thumb: if you have a reasonably complicated part of your shader network connected to multiple inputs on another shader (or shaders), consider using a cache node to avoid duplicate work. As always, test your render times before and after to make sure it was necessary.

Message 3 of 3
Slava_91
in reply to: Mike_Farnsworth

Thanks Mike!
exactly what is needed

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

Post to forums  

Autodesk Design & Make Report