AcademySoftwareFoundation / MaterialX

MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers.
http://www.materialx.org/
Apache License 2.0
1.87k stars 352 forks source link

[Khronos] MaterialX Specification for glTF texture procedurals #1906

Open ashwinbhat opened 4 months ago

ashwinbhat commented 4 months ago

I'm relaying a request on behalf of members on Khronos glTF PBR Procedural Texture group committee. The proposed extensions:

  1. KHR_texture_procedurals
  2. EXT_texture_procedurals_mx_1_39

will allow defining procedural patterns graphs in glTF using MaterialX 1.39 standard library nodes.

We are seeking clarification on MaterialX Specification, specifically around expected behavior of nodes when invalid values are supplied. Will the MaterialX specification define the behavior or will the behavior be defined by the underlying language implementation (glsl, msl, osl etc). This is especially relevant for math, and operator nodes in MaterialX standard library. For example, consider sqrt node, what is the expected behaviour if input is negative?

In order for Khronos glTF PBR Procedural Texture group committee to proceed with using MaterialX 1.39 as a standard, it would be helpful if this behavior is clarified either at the node level or as a general guideline in the specification for each category of nodes.

jstone-lucasfilm commented 4 months ago

@ashwinbhat This is a good topic, and my sense is that clarifying the edge-case behavior of each node is an important goal for the MaterialX project, and will be relevant for both glTF and OpenUSD use cases.

Taking your example of the sqrt node, the MaterialX specification should state explicitly which inputs have defined and undefined behaviors, rather than leaving this documentation to individual shading languages.

ashwinbhat commented 4 months ago

Thanks @jstone-lucasfilm. I'm tagging @lexaknyazev for visibility.

kwokcb commented 2 months ago

Adding smothstep as a candidate for edge case docs based on this Slack post: https://academysoftwarefdn.slack.com/archives/C0230LWBE2X/p1724060123942189