question

Slava Panther avatar image
Slava Panther asked ·

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!

shadersmaterial
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

1 Answer

· Write an Answer
Mike Farnsworth avatar image
Mike Farnsworth answered ·

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.

1 comment Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Thanks Mike!
exactly what is needed

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.