-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Import MaterialX for procedural materials #714
Comments
Started work on this https://github.com/fire/MaterialX/tree/godot-gltf. The design is to turn MaterialX into StandardMaterial3D. What works:
What doesn't work:
|
This is not strictly related, but what's your opinion on the USD material format? Many PBR material websites such as AmbientCG now provide ZIP archives with USDA and USDC files inside (example). |
@Calinou We can support USD this through our Blender integration pull request. I do not think it's a good use of time / effort to implement a skeleton animation level capable USD gdextension plugin in the near future. The addon will get you most of the way to "USD" import. |
I think we could have standalone USD material importing, even if we don't implement the full USD specification. It makes setting up PBR materials much faster, and could possibly obsolete #2316 (although converting textures to ORM is still more efficient). That said, this can likely be implemented by a GDScript add-on already (using a custom importer). |
To fully implement MaterialX import, I'll need to propose adding GLTF Specular and GLTF Volumetric shaders to Godot Engine. References
|
To be clear, USD material support is in MaterialX and I've requested GLTF support too. https://github.com/fire/MaterialX/tree/main/resources/Materials/Examples/UsdPreviewSurface |
In order for godot to become the "metaverse" browser it is supposed to become, it needs to support materialx. |
There’s missing vulkan support, but I can try looking. |
I've been working on a MaterialX to VisualShader converter recently at https://github.com/expenses/godot-materialx/. Progress has been going smoothly and it can handle some pretty complex materials fairly well. I have a couple of questions for people more knowledgeable about Godot's shading system than I am:
|
Now that's a great work,
Not sure, but I don't think visual shaders are going any way soon, personally I use them a lot, also at core they just translate to Godot Shading Language, and from what I have seen, the shader community cares about the Visual Shaders and even makes an addons for it : https://godotengine.org/asset-library/asset/1745 I think you should keep converting to Visual shaders, and any one who wants to use shader language can convert easily using Godot built-in converter. for the rest, sorry my shader knowledge is weak to know the answers ;p |
BaseMaterial3D has backlighting properties, which can be replicated in a custom shader by setting Subsurface scattering also has a transmittance property you can enable. This is more realistic but slower to render. |
https://github.com/expenses/usd-mtx-scripts/blob/main/mtlx-to-godot.py has an implementation of materialx to visual shaders as a proof of concept. https://github.com/blender/blender/tree/universal-scene-description need to ask Blender to support conversion of Blender material to usd material as a python function. |
Describe the project you are working on:
Not for my project.
Describe the problem or limitation you are having in your project:
@StraToN asked if there were plans to support Material Definition Language at some point for importing shaders (https://docs.substance3d.com/sddoc/mdl-material-definition-language-145653991.html)
MDL (Nvidia), Arnold(Autodesk), Open Shader Language(Sony?) and Principled BSDF (Blender Foundation) make bad candidates for use as a material library. MDL is not vendor neutral. Arnold is proprietary. OSL is not an interactive format. Principled BSDF is not exportable outside of Blender.
MaterialX avoids those problems. https://www.materialx.org/Specification.html
Instead of using texture sheets, we can trade runtime performance for procedural material definitions. The procedural materials can also be baked.
Existing proprietary tooling can be used for material artists to create a catalog of opensource materials. https://share.substance3d.com/libraries/6111
Blender can be convinced to make a MaterialX exporter.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Write a MaterialX to glsl rendering importer.
Notes: https://github.com/materialx/MaterialX/blob/master/documents/DeveloperGuide/ShaderGeneration.md
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
This is a picture of a green base color in Substance Designer opened in the MaterialX viewer.
This is a picture of Godot icon image as a resource in Substance Designer opened in the MaterialX viewer.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Generating shader graphs is non-trivial. Both ux and rendering materials require work.
Is there a reason why this should be core and not an add-on in the asset library?:
I think this can be a GDNative addon in theory. MaterialX is a native code library. Wanted to post the proposal here for review.
Other
I am not working on Import MaterialX for procedural materials, feel free to take on the task.
The text was updated successfully, but these errors were encountered: