Skip to content

Commit

Permalink
Updated MaterialX documentation for recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JGamache-autodesk committed Jul 4, 2022
1 parent 9c8633f commit 9480ec7
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions doc/MaterialX.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,38 @@ We currently support exporting to MaterialX-compatible UsdShade networks:
- Connections to color components and alpha/luminance
- Normal maps
- Custom color spaces
- Place2dTexture
- The ColorCorrect nodes from LookdevKit
- The clamp utility node
- Inserts explicit type conversion nodes where Maya uses implicit conversion
- Exports connections at the component level

### Partially supported:

- Lambert, Blinn, and Phong shader nodes are exported as MaterialX approximations. This allows roundtripping.

### Not supported:

- Lambert, Blinn, and Phong shader nodes
- Layered and ramp surface shaders
- Most of the Maya shader utility nodes
- MaterialXSurface shader nodes from MaterialX Maya contrib

### To enable:

Two options:
- Install MayaUSD v0.16.0
- Install MayaUSD v0.16.0 or later
- Rebuild tip of MayaUSD repo using a MaterialX-enabled build of USD

## Import

We can import MaterialX networks.
- UsdShade networks consisting of MaterialX nodes used for shading in the `mtlx` render context
- `.mtlx` files referenced in a USD stage as converted by the `usdMtlx` plugin in USD
- Anything that was exported from Maya

### Not supported:

- MaterialX networks containing surface shaders other than standard surface or preview surface
- MaterialX networks containing surface shaders other than those exported
- MaterialX networks containing unexpected procedural nodes
- Importing to MaterialXSurface shader nodes

Expand All @@ -61,11 +72,13 @@ Maya spheres with standard surface shading:

The same spheres exported with MaterialX shading and loaded as a USD stage: ![alt text](./USDMaterialXStandardSurfaceSampler.JPG "USD MaterialX sampler")

- Some of the recently exportable Maya nodes require additional MaterialX nodegraph implementations supplied with MayaUSD (Phong, place2dTexture, LookdevKit::ColorCorrect)
- Tangents will be shader-generated. By default they are arbitrarily oriented along the X derivative in screen space, but if a texcoord stream is used in the shader, the tangents will be aligned with the U direction.
- Textures marked as sRGB will be automatically converted to Maya working color space. Limited to these working spaces: "scene-linear Rec.709-sRGB", "ACEScg", "ACES2065-1", "scene-linear DCI-P3 D65", and "scene-linear Rec.2020".

### Not supported:

- DirectX 11 viewport
- [Issue 1523](https://github.com/PixarAnimationStudios/USD/issues/1523): Color spaces
- [Issue 1538](https://github.com/PixarAnimationStudios/USD/issues/1538): MaterialX networks containing surface shaders other than standard surface or preview surface

### To enable:

Expand All @@ -77,16 +90,19 @@ Once the updated plugin is in use, the viewport will automatically select Materi

### Building a MaterialX-enabled USD compatible with MayaUSD

We currently use MaterialX 1.38.3 and USD 21.11. Combining these two together requires patching USD:
Requires patching USD:

For USD 22.05b:
```
git checkout tags/v21.11
# Fetch updates selected for next USD release
git cherry-pick 08a5644770d063fe355aff1a2069b22b84d8402a
git cherry-pick adfc04eea92b91965b0da68503539b079a5d30d9
git cherry-pick 4ac8a7e9a440695f0392a94e27db1683773fce76
git checkout tags/v22.05b
# Fetch updates for MaterialX 1.38.4:
git cherry-pick ac3ca253e643a095e0985264238be28b95109a44
git cherry-pick 034df39a78a5fc4cada49b545ad2a87fd6666e1d
git cherry-pick aaf20de564e29c3e59bcd32b3539add08b7597c6
git cherry-pick 8a1ad41d27e2f1b9595a7404a7f8a89dce5cb5bc
git cherry-pick e6edb7e8fd74f3f0d5cd981450df0c937a809257
```

Then you need to merge the pending MaterialX v1.38.3 update submitted as [pull request 1738](https://github.com/PixarAnimationStudios/USD/pull/1738)
Tip of USD dev branch is already using MaterialX 1.38.4

Then you build USD using the `build_usd.py` script and the `--materialx` option.

0 comments on commit 9480ec7

Please sign in to comment.