-
Notifications
You must be signed in to change notification settings - Fork 360
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
JavaScript support for additional shader generators #1771
JavaScript support for additional shader generators #1771
Conversation
Hi @jstone-lucasfilm . |
@kwokcb What are you imagining as the use case for this feature, where a JavaScript application would generate OSL or MDL code? |
OSL can be transpiled to hardware shading languages so is worthwhile to consider. I think MDL could be dropped -- I already don't include it in my local builds. |
@kwokcb Is there a specific use case that you've run into, where this additional functionality in MaterialX would be beneficial? Since this proposal adds new source code, I'm aiming to understand the potential benefits of the change to developers and users, so that we can weigh this against the additional code complexity. |
The aim was to provide a way to see the output for supported languages and see what different code generation options / optimizations will do for different shader graphs and be able to examine and pull out source + shader reflection data. This could be used for shader uniqueness comparison or transpiling. I don't think it really adds any code complexity. It just allows builds to have different generator options. Currently you have to create an ESSL code generator explicitly (same as in C++ and Python). BTW, to me, the real complexity is the mixing of all languages code + definitions which would be a second step to only pack / load required dependencies for a given language. |
I think this idea a lot - would allow the creation of a website like godbolt, but for MaterialX files. |
Got it, and I'm sold on the idea of Godbolt for MaterialX files. Let's move forward with this change, and we can see how it ends up being used in the future. |
da837b5
into
AcademySoftwareFoundation:dev_1.39
Proposal
Make it possible to build or deploy a non-ESSL shader generation for the Javascript module: MaterialxGenShader.
Changes
Allow building a deployment of other "core" code generators based on build flags.
Remove forced disabling of generators in root Cmake file.