OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

Autodesk: Simplify materials with CM on static values

Open erikaharrison-adsk opened this issue 5 months ago • 5 comments

Description of Change(s)

Reduces the number of shader compilation across materials that differ only by a static color managed value.

There is no need to give color managed static colors to MaterialX as this will require adding CM nodes to convert constant values. Far better to compute the values once and set them into the shader already in the rendering color space.

Also note that MaterialX will not know how to handle a node with two color managed static colors when they differ in the color space name.

Link to proposal (if applicable)

  • N/A

Fixes Issue(s)

  • N/A

Checklist

erikaharrison-adsk avatar Oct 09 '25 22:10 erikaharrison-adsk

@meshula A test case for this change is: nanocolor_names_test.zip With expected result: image Note that this file does not exercise the new ColorSpaceAPI, we might have a more extensive test coming at some point in the future. It does test a mix of MaterialX and Nanocolor names though.

JGamache-autodesk avatar Oct 10 '25 13:10 JGamache-autodesk

Tried adding ColorSpaceAPI to that example file: nanocolor_names_test_with_CS_API.zip And the color space does not seem to be currently transported by Hydra even though a call to ComputeColorSpaceName returns the expected result at the USD level.

I suppose that work is yet to be done, and requires deciding how the color space gets propagated to descendants. Will we end up with a colorSpace:__color_attr_name__ for each affected attribute, or will we get the equivalent of a colorSpace:__full_prim__ to tell that all GfColor and SdfAsset values in that prim are affected. To be confirmed.

JGamache-autodesk avatar Oct 10 '25 13:10 JGamache-autodesk

Filed as internal issue #USD-11538

(This is an automated message. See here for more information.)

jesschimein avatar Oct 10 '25 17:10 jesschimein

Just confirming that the Hydra side of ColorSpaceAPI is planned but not yet available.

spiffmon avatar Oct 10 '25 18:10 spiffmon

Thanks @spiffmon! I see that it will be available in next release via c62c30951dbf91 by @klucknav.

JGamache-autodesk avatar Dec 16 '25 15:12 JGamache-autodesk