You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview:

MaterialX is an open standard for representing rich material and look-development content in computer graphics, enabling its platform-independent description and exchange across applications and renderers. MaterialX content can be encoded in other containers such as Usd, gltf and other formats. Similar to how a file can be transported in a zip package and ensure it’s integrity, it is essential that when MaterialX data flows in and out of these containers it's integrity is maintained.

The current MaterialX import in Hydra is handled by the UsdMtlx plugin.  MaterialX document can be imported into Usd/Hydra by:

(see MaterialX in Hydra slides  https://www.materialx.org/assets/ASWF_OSD2021_MaterialX_slides_final.pdf)

There is no support for exporting Shader networks to MaterialX.


MaterialX as UsdShade:
(transport, composition, file format plugin, interop, shader definition)


The import workflow of MaterialX to UsdShade is done by the UsdMtlx plugin. The UsdMtlx plugin translates MaterialX data to UsdShade. 

The UsdMtlx documentation outlines many of the unsupported features. These limitations cause data loss and prevent use of MaterialX with Usd/Hydra for Production use. Adding support for some of these features will require more in-depth discussion with the Usd Team and more engagement from the community. However, some low hanging items can be addressed as Pull requests to Usd by the community. 

Goal: Implement missing features in UsdMtlx Plugin, such that MaterialX content is maintained when imported into Usd.

These includes improvements to:

  • Shader Definition:  Treat MaterialX nodedef attributes (units, color space, fallbacks value, limits) as Shader data attributes instead of metadata. 
  • Shader Discovery:  Standardize on nodedef/nodegraph name mapping for better discovery of node variants. Improve versioning and nodedef namespace.
  • User Shader libraries:  Simplify transport of Custom nodedef (for modeling and viewport workflow)
  • Interop Integrity: For lossless synchronization, ensure validation mechanism / tests for Mtlx → UsdShade → Mtlx

For HdStorm, a MaterialX document is reconstructed from UsdShade Network to create glslfx via CodeGen. The missing features in the UsdMtlx plugin makes HdStorm hard to use and extend for other Viewport work-flows. 

MaterialX in Hydra:
(visualization, viewport, runtime, rendering)

To leverage MaterialX CodeGen (or ShaderGen) functionality in Hydra a delegate is required to reconstruct a MaterialX document from UsdShade or natively handle UsdShade graphs. 

Therefore an application is required to maintain MaterialX for rich material authoring workflows and translate to UsdShade networks for rich runtime visualization workflows.Often, an application might need to revert back to MaterialX for rich transport of material assets.
This dual mode operation requires unnecessary Shader Code regen such as during:

  • MaterialX topology updates require complete UsdShade regen.
  • MaterialX input updates require complete UsdShade regen.


We want to continue to use USDShade as the native runtime in Hydra but we want MaterialX as the ground truth and not have static snapshots in Usd form as they are duplicates that can get out of sync.

Goal: Improve MaterialX - UsdShade updates (both topology and inputs)

This includes improving performance issues due to shader recompilation, handling updates to materials, material topology changes. We may also need to introduce Hydra and/or MaterialX APIs to report material input and network updates.

Miscellaneous items (for further discussion)

  • For multi-backend support for Vulkan, MDL, Metal, etc applications need to maintain multiple Shader Gen paths that can easily get out of sync and are hard to maintain.
  • MaterialX nodes as ground truth definitions of UsdPreviewSurface. 
  • UsdLux v.s MaterialX Light nodes
  • Customize shaders for selection, highlighting. 
  • For Hardware renderers customize shader stages, render state management 



Examples (for review)

MaterialX Examples


Namespaces and versioning usage

https://github.com/autodesk-forks/MaterialX/blob/adsk_contrib/dev/resources/Materials/TestSuite/adsklib/archviz/adsk_metal.mtlx

Tokens usage

https://github.com/autodesk-forks/MaterialX/blob/adsk_contrib/dev/resources/Materials/TestSuite/adsklib/adsk_token_node.mtlx

Node variations:

https://github.com/autodesk-forks/MaterialX/blob/adsk_contrib/dev/resources/Materials/TestSuite/pbrlib/surfaceshader/unlit_surfaceshader.mtlx

  • No labels