Open fire opened 4 years ago
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 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 https://github.com/godotengine/godot-proposals/issues/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.
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:
thin_walled
boolean map onto the Backlight
param?rim
and rim_tint
params and the MaterialX/glTF sheen params (see https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen, https://github.com/godotengine/godot-proposals/issues/1934)Now that's a great work,
How well supported and stable are VisualShaders compared to the shading language? Are things moving more towards the node-based system or away from it?
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 also if you look at the godot shaders website : https://godotshaders.com/ you will find a mix of both, some use visual shaders, and some use shader language, but I guess the domninant is shader language.
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
What kind of support does Godot have for transmissive surfaces (KhronosGroup/glTF@main/extensions/2.0/Khronos/KHR_materials_transmission)? Is this something that can be added to VisualShaders without shading lang/system changes?
BaseMaterial3D has backlighting properties, which can be replicated in a custom shader by setting BACKLIGHT
in fragment()
: https://github.com/godotengine/godot/blob/ec62b8a3ee1d731387a440b4d2abb7961aa28322/scene/resources/material.cpp#L1459-L1467
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.