-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
GLTFLoader support KHR_texture_procedurals #30181
Comments
Would the proposal be to have a |
This is actually the direction I was thinking. the question I have is if the work should be done as a plugin/extension add on or as a pr modification to the core loader itself. I attended many talks where they discussed this being a priority but in at least reading what’s public on github it’s a bit early still. there are a few changes to the spec even I want to propose. If the work was done as an add-on (or even totally external) the changes in the spec wouldn’t be as impactful to core. —- This is something I’m super interested in and helps me learn the core of Nodes/TSL so I’m willing to champion the effort but if you (@sunag) would prefer to oversee the loader I’d understand. there are a handful of major GLTF efforts ongoing and other platforms already have working versions , this felt like a good place Three could also be involved and lead on |
@sunag if you get the chance can you take a look at the spec? The issues I have:
Probably more but that’s what stands out… |
It would be great to have some help with this, I'm not currently working on it, any help is welcome. |
Uniforms are an option for input nodes, it's a boolean tag I believe.
consider: <input name="dirt_color" type="color3" value="0.56372, 0.56372, 0.56372" uiname="Dirt Color" uifolder="Dirt" />
<input name="dirt_amount" type="float" value="0.248" uimin="0" uimax="1" uiname="Dirt Amount" uifolder="Dirt" />
<input name="uvtiling" type="float" value="3" uisoftmin="1" uisoftmax="16" uiname="UV Tiling" uifolder="Texturing" /> The inputs have a variety of possible parameters related to how they would be used in a UI system. Min, max, step, etc. I could have sworn they had UI XY positions for in the editor but maybe that was a different system |
Found it. It's in the spec and any node can have it:
|
Description
GLTF is gearing up to be the final mile delivery system for 3D platforms. One of the key goals expressed is better interoperability between GLTF and OpenUSD. One of the primary ways to do that is supporting MaterialX.
To do that, GLTF first wants to support procedural materials (including MaterialX) through a JSON defined node graph system for materials: https://github.com/KhronosGroup/glTF/tree/KHR_texture_procedurals/extensions/2.0/Khronos/KHR_texture_procedurals
From there, different systems/versions of procedural materials can be loaded, (however this primarily seems to be aimed at specifying versions of MaterialX, though I could see it supporting other systems)
Outline of GLTF/MaterialX 1.39
Link to the PR
At Siggraph 2024 Asia this was highlighted as done/near done and also one of the key goals within gltf. This is 100% happening and I think threejs should be a leader of it's implementation or at a minimum prepared for it.
This issue is first to mark the item within threeJS and hopefully could act as a holder of other issues related to it. I searched (a little) and found some issues mentioning parts of this, but it's hard to understand what is happening without following all open issues.
Solution
The first task would be parsing the GLTF Json into a ThreeJS material using TSL and the correct material type.
I'm not sure if the GLTF system can tag in a way if a material would need to be a basic, standard, or Physical material, however it could be built as a standard material and then rebuilt as a basic if it only has the basic inputs or a physical if it has the more complex ones. (implementation discussion)
I know there is currently a materialX loader, however, that is parsing the XML matx files and not this converted JSON. A new parser would have to be put together but could use that as a starting point.
I am willing to start working on this in my desire to do more for things within gltf, however I didn't want to start if @sunag already had something in the works
Alternatives
Additional context
There are a million links to MaterialX stuff. But MaterialXLearn might be the easiest to link to all the other resources, see graphs, editors, etc.
The text was updated successfully, but these errors were encountered: