Skip to content

Conversation

ld-kerley
Copy link
Contributor

Introduce more concrete API calls to MaterialXCore, to help make the interface to Shader Generation more direct.

Functions added:

  • Access for the "bsdf" attribute on a nodedef element
  • Access for the "sourcecode" attribute on an implementation element.

Also use these MaterialXCode API calls, and others in the Shader Generation code, in favor of more generic getAttribute(attrName) calls.

…inteface to Shader Generation more direct.

 Functions added to access the "bsdf" attribute on a nodedef element, to access the "sourcecode" attribute on an implementation element.

 Also use MaterialXCode API calls in favor of more generic getAttribute(attrName) calls.
Copy link
Contributor

@niklasharrysson niklasharrysson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

I just want to point out that the "bsdf" attribute on NodeDefs isn’t documented in the specification, as far as I know. It was originally added as a hint for codegen, to indicate whether a BSDF is reflective, transmissive, or both. One could therefore consider it an implementation detail that should remain internal, in which case it might be better not to publish an API for it.

That said, I think it’s a useful hint that could benefit any backend. So exposing it in the API makes sense to me. Perhaps we should then consider adding it to the specification as well.

@ld-kerley
Copy link
Contributor Author

I've actually been bumping in to some other things with the node classification stuff in the shadergen - so I might actually want to hold off on this change for now.

I'll try and write up a different issue to discuss the classification things I've been thinking about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants