-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Create a MaterialX graph for the glTF BSDF #2001
Comments
See #1949 for some information on MaterialX and how a glTF BSDF fits in (scroll down a bit, the original discussion went off-topic and arrived at MaterialX). In particular, the last comment contains a few hints on how to get started and how to validate results. |
Reposting for ease of review.
|
@proog128 Do you have a full materialx sample I can try creating an automated material to png github cicd sample for? |
From an gltf2 extension standards point of view the missing steps seem to be:
|
@fire I think a glTF extension would only be needed if we were attempting to include all of MaterialX as a glTF material extension. This is a lot to ask from glTF implementations and viewers, some of which are lightweight and don't support MaterialX. The current thinking is to go the other way around: Implement the glTF PBR material (including recent PBR extensions) as a new Does that sound useful / reasonable? We have a prototype of this going, see KhronosGroup/MaterialX#1. |
Proposed workflow:I want to transmit a final character gltf2 that has MaterialX procedural materials embedded into it and the MaterialX inputs are changed via different MaterialX file.
For example: we have a woman wearing yoga pants and t-shirt. Every material including the design graphic of the t-shirt and on the pants is defined in MaterialX. Variations are provided as different MaterialX files. Your proposed workflow is:
This is the prototype today with the experimental MaterialX gltf2 brdf. Criticism:
|
Yeah. My concern is, this sounds like "artist interchange" territory, not runtime transmission/delivery. The goals of glTF lie wholeheartedly in the latter category, focused on delivering finished assets to thick and thin clients. The scope of glTF has expanded a bit as mobile clients today are far less "thin" than in the past, and online model exchange via glTF has become commonplace. End users are of course free to use glTF for any purpose they see fit, but official Khronos efforts are encouraged to remain focused on the core goals of the format. Of course we can't rule out the possibility of a full MaterialX extension for glTF in the future, for example a possible future in which MaterialX rendering has become near-universal. If you want to get a jump start on that, the webp extension you mention above is certainly a great starting point, and |
That sounds good. The missing piece for the above is a MaterialX BSDF baker, I appreciate the Khronos members making that work. |
While I agree that supporting all of MaterialX is a lot to ask of thin clients, there's no way in the current glTF workflow to create custom materials. This has resulted in a number of custom extensions for apps like Mozilla Hubs where there is need to implement materials like water or animate UVs or something more advanced. In the past, glTF has had support for embedding custom shaders however this was WebGL specific and presents many challenges for asset portability. MaterialX has standard nodes for time, frame, and up vector, which are basic, but provide a useful way to at least start on some sort of dynamic material. If there were a glTF compatible output node defined for MaterialX, I do think that runtime generation of a shader targeting that output node would be fairly powerful and cover most of the gaps left in the current material definition. The current static material is great, but artists working on games are currently left with a huge gap in their workflow. If not MaterialX, what other alternatives have been suggested for standardizing custom materials for glTF? |
I'm not aware of any better alternative than (or even a comparable alternative to) MaterialX for portable shader graphs. I think the big questions here have more to do with viability – particularly for runtime loading. I'd venture to guess (and would be glad to be proven wrong!) that no one is actually using MaterialX for runtime loading in performance-sensitive applications today. That's not to say it isn't possible, but it does seem like a strong sign that it's too soon to have official support in glTF. A glTF-compatible output node for MaterialX, or a similar 'baking' target, would be a good step in the right direction I think. |
I have an implementation of a Material Graph for raytracing (already in production) that could implement this: Sorry about the half finished presentation, you should get the picture. My $0.02 you should standardize the AST/IR/IL of the material graphs [while looking to cover MaterialX/NvidiaMDL/Mitsuba], and if possible keep it binary. Basically keep ye-good-olde compiler design of Leave it up to the consumer of glTF how to implement the backend. |
Oops, this old issue never got closed. The MaterialX graph for glTF's PBR first shipped with MaterialX 1.38.4 about 6 months ago, and has been refined a bit since then. Usage examples are here: |
I am investigating making a match for the glTF BSDF.
See AcademySoftwareFoundation/MaterialX#653
The text was updated successfully, but these errors were encountered: