.. _Material Graph: ============================ Material Graph ============================ Overview ----------------- .. image:: /content/images/material_graph_main.PNG :align: center :alt: Material Graph The Material Graph allows for the authoring of custom material shade graphs. The graph is composed of shading nodes connected together and stored as UsdShade_ within the stage. .. _UsdShade: https://graphics.pixar.com/usd/docs/api/usd_shade_page_front.html Nodes ############## Provided with the Material Graph is a comprehensive list of MDL, BSDFs, and functions. Materials and functions are represented as drag and droppable nodes in the Material Graph Node List. Materials ^^^^^^^^^^^^^^^^^^^^^^ .. toctree:: :maxdepth: 1 :glob: ext_material-graph/nodes/Materials/metal.rst ext_material-graph/nodes/Materials/plastic.rst ext_material-graph/nodes/Materials/retroreflective.rst ext_material-graph/nodes/Materials/flexible.rst ext_material-graph/nodes/Materials/thin-glass.rst ext_material-graph/nodes/Materials/thin-translucent.rst ext_material-graph/nodes/Materials/thick-glass.rst ext_material-graph/nodes/Materials/thick-translucent.rst ext_material-graph/nodes/Materials/flaky.rst ext_material-graph/nodes/Materials/OmniHairBase.rst ext_material-graph/nodes/Materials/OmniSurfaceBase.rst ext_material-graph/nodes/Materials/OmniSurfaceBlend.rst ext_material-graph/nodes/Materials/OmniSurfaceLiteBase.rst ext_material-graph/nodes/Materials/simple-diffuse.rst Materials Modifiers ^^^^^^^^^^^^^^^^^^^^^^ .. toctree:: :maxdepth: 1 :glob: ext_material-graph/nodes/Material_Modifiers/surface-blender.rst ext_material-graph/nodes/Material_Modifiers/surface-falloff.rst ext_material-graph/nodes/Material_Modifiers/apply-clear-coat.rst ext_material-graph/nodes/Material_Modifiers/apply-thin-film.rst ext_material-graph/nodes/Material_Modifiers/apply-thin-metal-coating.rst ext_material-graph/nodes/Material_Modifiers/apply-dust-cover.rst ext_material-graph/nodes/Material_Modifiers/apply-color-falloff.rst ext_material-graph/nodes/Material_Modifiers/apply-flake-coating.rst ext_material-graph/nodes/Material_Modifiers/add-cut-outs.rst ext_material-graph/nodes/Material_Modifiers/add-simple-sticker.rst ext_material-graph/nodes/Material_Modifiers/add-global-bump.rst ext_material-graph/nodes/Material_Modifiers/add-displacement.rst ext_material-graph/nodes/Material_Modifiers/add-emission.rst ext_material-graph/nodes/Material_Modifiers/add-thermal-emission.rst Texturing High Level ^^^^^^^^^^^^^^^^^^^^^^ .. toctree:: :maxdepth: 1 :glob: ext_material-graph/nodes/Texturing_High_Level/bitmap_texture.rst ext_material-graph/nodes/Texturing_High_Level/bitmap_bump.rst ext_material-graph/nodes/Texturing_High_Level/normal.rst ext_material-graph/nodes/Texturing_High_Level/blend-colors.rst ext_material-graph/nodes/Texturing_High_Level/blend_normal.rst ext_material-graph/nodes/Texturing_High_Level/perlin-noise.rst ext_material-graph/nodes/Texturing_High_Level/perlin-noise-bump.rst ext_material-graph/nodes/Texturing_High_Level/cellular-noise.rst ext_material-graph/nodes/Texturing_High_Level/cellular-noise-bump.rst ext_material-graph/nodes/Texturing_High_Level/flow-noise.rst ext_material-graph/nodes/Texturing_High_Level/flow-noise-bump.rst ext_material-graph/nodes/Texturing_High_Level/3d-checker.rst ext_material-graph/nodes/Texturing_High_Level/3d-checker-bump.rst Texturing Basic ^^^^^^^^^^^^^^^^^^^^^^ .. toctree:: :maxdepth: 1 :glob: ext_material-graph/nodes/Texturing_Basic/texture_lookup_float.rst ext_material-graph/nodes/Texturing_Basic/texture_lookup_float3.rst ext_material-graph/nodes/Texturing_Basic/texture_lookup_float4.rst ext_material-graph/nodes/Texturing_Basic/texture_lookup_color.rst ext_material-graph/nodes/Texturing_Basic/is_texture_valid.rst ext_material-graph/nodes/Texturing_Basic/width_of_texture.rst ext_material-graph/nodes/Texturing_Basic/height_of_texture.rst ext_material-graph/nodes/Texturing_Basic/width_of_texture_tile.rst ext_material-graph/nodes/Texturing_Basic/height_of_texture_tile.rst Math Functions ^^^^^^^^^^^^^^^^^^^^^^ .. toctree:: :maxdepth: 1 :glob: ext_material-graph/nodes/Math_Functions/* Constants, State and Primvars ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. toctree:: :maxdepth: 1 :glob: ext_material-graph/nodes/Constants_State_Primvars/* Constructors, Conversions, and Swizzles ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. toctree:: :maxdepth: 1 :glob: ext_material-graph/nodes/Constructors_Conversions_Swizzles/* Advanced ^^^^^^^^^^^^^^^^^^^^^^ .. toctree:: :maxdepth: 1 :glob: ext_material-graph/nodes/Texturing_High_Level/bitmap_texture.rst ext_material-graph/nodes/Texturing_High_Level/blend-colors.rst ext_material-graph/nodes/Texturing_High_Level/perlin-noise.rst ext_material-graph/nodes/Texturing_High_Level/cellular-noise.rst ext_material-graph/nodes/Texturing_High_Level/flow-noise.rst ext_material-graph/nodes/Texturing_High_Level/3d-checker.rst Miscellaneous ^^^^^^^^^^^^^^^^^^^^^^ .. toctree:: :maxdepth: 1 :glob: ext_material-graph/nodes/Miscellaneous/backdrop.rst ext_material-graph/nodes/Miscellaneous/NodeGraph.rst ext_material-graph/nodes/Miscellaneous/Input_Node.rst ext_material-graph/nodes/Miscellaneous/Output_Node.rst Custom User Nodes --------------------- You can can add custom MDL nodes to the Material Editor by adding MDL modules to the **"User Allow List"** in the Material Preferences .. image:: /content/images/material_graph_custom_nodes.png :align: center :alt: Custom OmniImage Nodes User Allow List ################## To add MDL functions and Materials to the Material Editor node list, use the plus button to the right of the **"User Allow List"** list. Modules listed in the Allow list must also be included somewhere in the `MDL Search Path `__. .. image:: /content/images/material_graph_allow_list1.png :align: center :alt: Custom OmniImage Nodes User Block List ################### To exclude a module from the node list, add the module the **"User Block List"**. Use the plus button to the right of the **"User Block List"** and add the name of module you wish to exclude from the node list. Material Config ################### Adding MDL modules to the **"Allow"** and **"Block"** lists are specified in the **material.config.toml** in the **$HOME/Documents/Kit/shared** folder. **material.config.toml** :: [materialGraph] userBlockList = [ "OmniShared.mdl" ] userAllowList = [ "OmniImage.mdl" ] Exporting Functions and Materials ########################################## Functions and materials that are prefixed with **export** are made available to the editor and referenced in UsdShade using the sourceAsset and subIdentifier info attributes. **OmniImage.mdl** .. code-block:: none export base::projection_mode to_native_projection_mode(uniform projection_mode mode) { ... } export float3 compute_latitude_longitude_projection(float3 pos, uniform float3 rotation) { ... } export base::texture_return texture_lookup_2( uniform texture_2d texture = texture_2d(), uniform bool ignore_missing_texture = false, color missing_color = color(0.0), uniform bool use_uv_coords = false, float2 uv_coords = float2(0.0), uniform wrap_mode s_wrap = wrap_periodic, uniform wrap_mode t_wrap = wrap_periodic, base::texture_coordinate_info texture_coordinate_info = base::texture_coordinate_info()) { ... } .. image:: /content/images/material_graph_custom_nodes_crop.png :alt: Custom OmniImage Nodes .. raw:: html