Arnold Shader Network

 

The Arnold Shader Network Editor allows you to view, modify and create shader node connections in an easy to use editable schematic window. The Arnold Shader Network material can be found under Create > Shader > Arnold Shader Network in the Material Manager or you can press Alt+W and N. You can also create shaders directly from the Create > Arnold menu. In this case, an Arnold Shader Network is created with the selected shader as the root.

A video that demonstrates working with the Arnold Shader Network editor can be found here. A video that demonstrates bump/displacement workflow in the Arnold Shader Network editor can be found here.

When the IPR is running, material previews are not rendered because only one render session can be active in Arnold at the moment. If you stop the IPR, then the material previews will be updated. The last rendered preview is displayed with a small orange frame showing that the preview is delayed.

The Arnold Shader Network Editor shares similar functionality to the Xpresso Editor in Cinema 4D, however, it is limited to work only with Arnold shaders.

Note that there is an Arnold group in the standard XPresso editor, however, these nodes are not valid and have no effect. There's a technical reason these nodes cannot be hidden.

 

To open the Arnold Shader Network Editor, click on 'Open network editor...' under the Material tab. You can also use the middle mouse button or press Alt + W and O in the Material Manager on the selected material.

Arnold Shader Network Editor window. Standard shader's output connected to Arnold beauty input port.

The editor has three sections:

  1. You can see the preview of the whole network on the left and a tree of available shaders. Arnold shader nodes and supported C4D shaders are listed in the tree and are grouped by functionality. All groups have a color assigned to them so that you can quickly identify the shader type in the editor. These colors are hardcoded and cannot be changed, however, you can set your own title color for any shader nodes in the network.
    The tree has a filter field for quickly navigating through the various shaders. When you start typing, shader nodes containing the given substring will only be displayed. You can also use arrow keys to navigate in the tree. To create a new shader just press the 'Enter' key.
  2. The work area is in the center of the dialog. This is a graph view editor where you can connect shader nodes together via linkable attributes (called ports). You can drag & drop any shader from the left tree to the work area. To connect shaders you have to click on the Output port and drag the mouse to the blue corner of the other shader. A menu will appear listing the available parameters that you can connect to.

    The root of the network has to be connected to the Arnold Beauty port of the main group. There are multiple outputs available (such as Arnold Displacement). You can add them by clicking on the red corner of the main group.

    You can enable display of the port names by right-clicking in the work area and selecting Port > Show Names from the context menu.

    If the shader has a color or vector output then its components (e.g. R, G, B or X, Y, Z) can be connected separately. Open the output port menu of the shader to access these components. Note that a component cannot be connected to the Arnold Beauty or Arnold Displacement ports.

  3. Parameters of the selected node are displayed on the right side. You can change any values here. Note that if a parameter is linked then it's not visible here. You have to disconnect it first to edit the constant value of the parameter.

 

You can drag & drop image file textures from an external file explorer directly onto the ASNE window and it will automatically generate an image shader.

You can also drag & drop a Vertex Map Tag from the object tree onto the ASNE window and it will automatically generate a vertex map shader.

Example Workflows

  1. Bump mapping
  2. Displacement mapping

Commands

The following commands are available in the shader network editor by a shortcut or from the context menu.

  • Set beauty root shader: with this command, you can quickly change the root shader by connecting the selected shader to the beauty port. This is useful when you want to quickly visualize a part of the network.
    • shortcut: Alt + W and V
  • Restore beauty root shader: if you changed the root shader with the previous command you can quickly restore the original root.
    • shortcut: Alt + W and X
  • Assign texture: this command creates an image shader with your texture connected to a selected parameter. It shows a menu where you can select a parameter of the selected shader. It then opens a file browser to select your texture. If multiple shaders are selected you must select one of them from the menu first. When no shader is selected you must select one from the network first.
    • shortcut: Alt + W and T
    • shader context menu: Operator > Assign Texture
  • Delete unused shaders: removes all shaders from the network which is not connected to any output port (e.g. Arnold Beauty, Arnold Displacement, etc.).
    • shortcut: Alt + W and D
  • Write texture...: allows you to write out the modifications of a texture (e.g. UV transform, color correction, mix, etc.). This feature is to prevent duplicating the network in photoshop when you want to edit a texture further. Just simply select the shader which you want to write out and execute the Write Texture... command. A dialog opens to set up the output path, format and resolution.
    • shortcut: Alt + W and W

      This feature is valid only for textures, you can not write out surface shaders (e.g. standard, curvature, etc.) or procedural textures (e.g. noise).

You can change the above shortcuts in the Window > Customization > Customize Commands... dialog. You can search by name or shortcut or sort by Plugin and find the C4DtoA commands.

Menu

About the Edit menu see the Commands section above.

  • View > Show attributes: When enabled (default) the attributes of the selected shaders are displayed on the right of the editor. When disabled the Attribute Manager is used instead. This is useful to save space for the editor area for example when the editor is docked.

Editing

You can use the following actions to quickly edit the network:

1. Add new shader

    • Press Ctrl + TAB (make sure the Arnold Shader Network Editor window is active).
    • Start typing the name of the shader you want to create or select from the list by the up/down arrow keys.
    • Press Enter to select the shader. The shader is added to the network at the mouse cursor or at the center of the window.
    • If a shader is selected when you press Ctrl + TAB then the new shader will be automatically inserted after or before the selected shader (depends on the shader type).
      • Select the parameter from the popup to connect the new shader to/from by the up/down arrow keys.
      • Press Enter. The new shader is inserted after/before the selected one.
      • You can press Esc if you don't want to insert the shader.

 

2. Insert after

    • Select the shader which you want to insert after another shader.
    • Drag & drop the shader onto the other shader.
    • Select an input parameter to connect to from the menu.
    • Select where to insert when the other shader has more connections. You can select 'all' which will insert the shader into all connections.
 

3. Insert before

    • Select the shader which you want to insert before another shader.
    • Drag & drop the shader onto the other shader and hold the Alt key.
    • Select 'insert before' from the menu.
    • Select an input parameter to connect to from the menu.
    Actually this feature is the same as connecting the output to the other shader, however in some cases (e.g. when we zoom out and the ports are small in the view) it's easier to drag & drop the whole node.

Hold ALT before dragging to reveal menu

4. Replace

    • Select the shader which you want to replace another shader with.
    • Drag & drop the shader onto the other shader and hold the Alt key.
    • Select 'replace' from the menu.

Hold ALT before dragging to reveal menu

5. Move connections

    • Select the shader which you want to move the connections from.
    • Drag & drop the shader onto another shader and hold the Alt key.
    • Select 'move outputs' from the menu.

Hold ALT before dragging to reveal menu

6. Connect/disconnect to/from multiple shaders.

    • Select the shaders you want to connect/disconnect to/from. They must be of the same type.
    • Add/remove a connection to/from one of the selected shaders and hold the Shift key.

Hold SHIFT when clicking on connection

7. Drag with children

    • Select the root shades of the hierarchy you want to move.
    • Press Shift and drag the shaders with the mouse.

8. Drag with parents

    • Select the leaf shades of the hierarchy you want to move.
    • Press Shift  + Alt and drag the shaders with the mouse.

9. Automatic node optimization

    • When you add a new connection to a shader it automatically expands. When you remove an existing connection, the port is automatically removed and the size of the node is optimized.
    • You can enable/disable this feature in the Edit menu of the network editor.

10. Automatic connection after delete

    • When you remove a shader, its first input is connected to the outputs automatically.
    • You can enable/disable this feature in the Edit menu of the network editor.

11. Automatic file browser when creating a new image shader

    • If you create a new image shader then a file browser opens automatically allowing you to select an image file
    • You can enable/disable this feature in the Edit menu of the network editor.

12. Add a port by drag & drop

    • Select a parameter from a shader in the Attribute Editor.
    • Drag & drop it to the shader node.

13. Shader selection

    • Press Page Up to select the next shader in the network. The order is defined by the connections. If nothing is selected then selects the last shader from the root.
    • Press Page Down to select the previous shader in the network. The order is defined by the connections. If nothing is selected then selects the root shader.

 

You can use the Help > Info... menu in the network editor to get information on the available editing actions.

A video that demonstrates editing shaders with the Arnold Shader Network editor can be found here.

Reference Another Network

You can drag & drop an Arnold Shader Network Material to the editor creating a reference. This feature allows you to use a network (e.g. a noise setup) in other networks, modifying the referenced network results an update in all parent networks. A reference can be used as an input only.

A network reference is displayed with a light gray background and has 'reference' in the title.

Cycles are not permitted which means you cannot reference network A in network B if network A already has a direct or indirect reference for network B.

Viewport

To display a shader in the viewport you have to connect it to the Arnold Viewport port.

Supported shaders are at the moment:

  • standard: diffuse, specular, refraction, emission weight, and color. Image shaders connected to diffuse, specular, refraction, emission color.
  • image: UV settings are not supported.
  • C4D Bitmap shader

Viewport display is limited and gives only a hint on the look, it does not necessarily match the final render in all cases.

Histogram

The histogram feature allows you to see how the pixels of an image are distributed. To enable the histogram click on the Texture > Show/hide histogram menu or press Alt+W ~ G. The histogram is displayed in the right panel above the attributes of the selected shader.

To display the output of a shader in the viewport you have to connect it to the Arnold Histogram port. The graph shows the pixels distributed by the selected property which could be:

  • RGB:  relative luminance in colorimetric spaces.
  • R: the red channel of the pixel.
  • G: the green channel of the pixel.
  • B: the blue channel of the pixel.
  • Luminance: brightness (luma).

Because the input of the histogram could be any shader from the network the sample resolution has to be defined manually. The default is 800x600 which gives a proper result in most cases. Higher resolution needs more time to process.

Samples

When the mouse is moved over the histogram the number of pixels at the level under the mouse pointer is displayed under the graph. By Ctrl + click you can add a fix sample point to the histogram to follow how the pixels of a given level change after modifying the shaders.

Third-party shaders are not supported by the histogram.

Quick edit

If you just need to quickly change some parameters of your shader you don't have to open the network editor. The Arnold Shader Network Material allows you to select any shaders of your network and displays its parameters as they are displayed natively in the Attribute Manager.

The edit mode is available only to change parameter values. If you want to change connections or add / remove shaders you must open the network editor window.

Material stacking

The native material stacking workflow is supported by C4DtoA even with the Arnold Shader Network Material. You can set the texture of the blending on the Alpha tab, similar to the native C4D material. Note that this alpha texture is used only for stacking, it has no effect on the shader network. Alternatively, you can link a shader network (another Arnold Shader Network Material) instead of a texture which gives more freedom and flexibility.

The plugin translates the material stacking as a layer_color shader with the materials as the layers in order and the alpha textures as the alphas. For more complex scenarios you have to manually build your network.

Material preview

Arnold materials are displayed using custom preview scenes which you can select by right clicking on the preview image. Scenes that are defined by C4DtoA start with an Arnold prefix. The default preview scene is the Arnold Sphere.

Available Arnold material preview scenes

The preview render can be disabled using the Render preview checkbox in the material interface. A disabled preview shows the last rendered preview with a small gray frame.

When a preview cannot be rendered because of an error (e.g. a texture is missing), it is displayed black with a small red frame around it.

User-defined preview scene

You can also create any custom preview scene you like. Just create a new scene or open and edit an existing one from $C4D_INSTALL/library/materialpreview. In the scene, set the renderer to Arnold Renderer and specify your settings. You can use any setup like you do in a normal scene, however, there are some special rules:

  • Add an empty tag to your main object (it can also be a Null object with child objects).
  • Name your front light to Light_Front, your back light to Light_Back. These are used by a light filter type material.
  • Change the name of your background plane to Background. This will be disabled by an atmosphere or environment type material.

 

Setup of the Arnold Sphere preview scene

 

You must save your scene to the $C4D_INSTALL/library/materialpreview folder with an Arnold prefix (like the built-in Arnold preview scenes). After restarting Cinema 4D it should appear in the preview context menu along with the other preview scenes.

You can delete any unused shaders in the Arnold Shader Network Editor with the menu: Edit -> Delete unused shaders

 

 

  • No labels