...
2. 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.There are two possible rendering workflows.
- The translation process to UsdShade and back to MaterialX is undesired. UsdShade allow for resolving of inputs only. That is optimally rendering can occur from
- the source MaterialX reference or
- shader code can be independently (pre)-generated from MaterialX (or other source) but is associated with USDShade nodes (e.g. code references per node in OSL).
- A translation process is required for UsdShade.
- If MaterialX is required then CodeGen (or ShaderGen) functionality is available.
- Ideally this would be outside of Hydra (which is not the current case)
Therefore an application is may be 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:
...
Goal: Improve MaterialX - UsdShade updates (both topology and inputs), USDShade with MaterialX source code, Hydra independence
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.
...