-
Notifications
You must be signed in to change notification settings - Fork 358
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
Smoothstep breaks GLSL compilation when multiple type signature nodes are used #1978
Comments
There are includes which I assume are not being checked to see if that file has already been included in the non-float code implementations
This breaks GLSL and Metal at least. |
Good catch, @HardCoreCodin, and this sounds like a bug in our GLSL shader generation that should be fixed. |
I think the fix is probably a pretty easy |
@ld-kerley , not sure if this is the place to look but I believe |
In this case the |
I think I see what's happening.... The float version of smooth step is added first, but because this is a The second (color) smoothstep node is also a I can see a few possible solves here.
I think in the long term I would vote for option 3, but I also think that option 1 might be the pragmatic answer in the short term, and perhaps we file these ideas as an issue to be working on in the future. Curious what you think, @kwokcb, @niklasharrysson, @jstone-lucasfilm ? |
I’ll just throw out one more option. Turn the vector versions of this into graphs that use the float version node instances — hence no include dependence exists. Would have to think some more on the other options, but adding the common include seems like a good idea if it is added on demand. |
I like the nodegraph implementation idea, though if we applied this to all destination languages, then I think we would be constructing less optimal OSL code.
OSL currently provides a I guess that raises a hole in my MaterialX understanding. If a |
Interestingly we already have "some" |
Yes, according to the Spec:
(The above sentence is in the paragraph right above the https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/documents/Specification/MaterialX.Specification.md#example-custom-node-defined-by-a-nodegraph section) |
There may be strong reasons in the near term to also have a custom |
@ld-kerley for your implementation matching question:
|
Issue #1978 reports an issue with repeated code for the smoothstep node. This PR will resolve that issue (and also add a unit test that demonstrates the issue) by converting all the smoothstep nodes to nodegraph implementations. This PR also simplifies the nodegraphs for smoothstep to allow follow the same pattern.
Thanks for this report, @HardCoreCodin, and to @ld-kerley for the fix in #1982! |
When multiple signature variants of smoothstep participate in a graph, the viewport render goes blank and this shows in the output:
This is likely because the function
mx_smoothstep_float
exists in multiple headers that get included in such cases.See attached example file.
smoothstep_failure_mtlx.txt
The text was updated successfully, but these errors were encountered: