Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for disabled nodes in shader generation #1687

Open
kwokcb opened this issue Feb 2, 2024 · 1 comment
Open

Add support for disabled nodes in shader generation #1687

kwokcb opened this issue Feb 2, 2024 · 1 comment

Comments

@kwokcb
Copy link
Contributor

kwokcb commented Feb 2, 2024

Issue

Currently the specification notes that outputs can have default inputs / values to handle if a node is disabled / pass-through.

Attributes for NodeDef Output elements:
name (string, required): the name of the output. For nodes with a single output, the name "out" is preferred.
type (string, required): the MaterialX type of the output.
defaultinput (string, optional): the name of an element within the , which must be the same type as type, that will be passed through unmodified by applications that don’t have an implementation for this node.
default (same type as type, optional): a constant value which will be output by applications that don’t have an implementation for this node, or if a defaultinput input is specified but that input is not connected.

This is currently not supported by shader generation.

Proposal

Update shader generation to recognize if a node has been disabled and use the default input or output on a node.

  • An issue is what to do if these defaults are not specified. E.g. should it be assigned to be 0 for scalars, false for booleans, unit matrix for matrices, empty string for strings etc ?

  • Assume that the logic is similar to that of a <dot> node which is a pass-through if connected ?

Related to this is to add in proper routing for <image> and interfaces routing through <image> nodes as noted in this issue.

@kwokcb
Copy link
Contributor Author

kwokcb commented Feb 2, 2024

@ld-kerley , @jstone-lucasfilm, @niklasharrysson : The "fallback" case for unspecified defaults I'm not sure about
as it was not discussed in the Slack thread. Add or correct the description as required. Thanks!

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

No branches or pull requests

1 participant