-
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
KHR_texture_procedurals Draft Proposal #2381
base: main
Are you sure you want to change the base?
Conversation
* Start document consolidation. * Transferred doc.
- Update checkerboard example with USD equiivalent and mermaid graph. - Add USD/ / MaterialX / glTF mapping
1. KHR_texture_procedural 2. EXT_texture_procedural_mx_1_39
…Add in mapping section for texture_infos.
|
||
## Handling MaterialX glTF PBR Nodes | ||
|
||
The glTF PBR node specified within MaterialX exposes a number of input ports which may not map 1:1 with the glTF PBR material |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently there is no way to do a proper mapping for metallic and roughness. Should a separate mapping for metallic and roughness be proposed. Should the MaterialX glTF PBR node be updated ?
|
||
More specifically __only__ nodes defined in the MaterialX specification are supported. This ensures that the procedural graphs can be easily converted to MaterialX and USDShade graphs. | ||
|
||
For the first version of this extension nodes which are used to define shading models are not allowed. Please refer to the [resources](#resources) section for links to supported MaterialX node definitions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the first version of this extension....
I do not understand this statement - this extension concerns creating images from operators/functions, instead of stored pixel values.
Where doshading models
fit into this?
I propose to remove this statement.
|
||
### Motivation | ||
|
||
Textures represented as procedural graphs provides a way to extend the capabilities of glTF materials beyond what is possible with traditional texture maps. Key objectives includes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reword to:
Images represented as procedural operators or functions provides a way to extend the capabilities of glTF textures beyond what is possible with bitmap based images.
|
||
1. **Interoperability**: Adhere to an industry a standard node schema (MaterialX) with a runtime friendly JSON representation. | ||
|
||
More specifically __only__ nodes defined in the MaterialX specification are supported. This ensures that the procedural graphs can be easily converted to MaterialX and USDShade graphs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures that the procedural graphs can be easily converted to MaterialX and USDShade graphs.
I don't see this as the goal for the extension - the goal is to create an agnostic way to store procedural images - that can then be used as texture sources in glTF.
|
||
For the first version of this extension nodes which are used to define shading models are not allowed. Please refer to the [resources](#resources) section for links to supported MaterialX node definitions. | ||
|
||
2. **Fidelity**: Provide the ability to generate complex patterns, noise, or other effects that currently must be "baked" into texture maps. Provide the ability to provide mappings from one shading model to another without baking in a consistent manner via procedural graphs. Provide the ability to map procedurals graphs to unlit materials. Reduces runtime memory usage by generating patterns / shading programmatically. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose something along the lines of:
Provide the ability to generate procedural patterns, noise or other visual effects of sufficiently high fidelity to replace the use of pixel (bitmap) based images.
Reduce the transfer size by generating images, either at load- or run-time.
|
||
2. **Fidelity**: Provide the ability to generate complex patterns, noise, or other effects that currently must be "baked" into texture maps. Provide the ability to provide mappings from one shading model to another without baking in a consistent manner via procedural graphs. Provide the ability to map procedurals graphs to unlit materials. Reduces runtime memory usage by generating patterns / shading programmatically. | ||
|
||
3. **Editability and Extensibility**: Extend runtime editability by exposing logic and interfaces for procedural graphs as well as providing a means to create new or extend existing node definitions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the goal of this extension - this extension should simply reference already existing operators/functions and provide a means to store them with a glTF asset.
|
||
### Material Binding | ||
|
||
To connect a graph `output` to a surface or displacement shader input the procedural extension can be declared within the a texture reference for a given material in the `materials` array. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to simply connect the procedurals to an image in the images
array - if this image is created at load time or dynamically created at runtime is up to the implementation.
</details> | ||
|
||
|
||
### Procedural Definitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose a solution where the procedural image extension uses a set of already declared operators/functions.
These functions are what are available, if need for future additions that will need to be done in a separate extension.
The upside of having pre-declared operators is that its straightforward to do implementation testcases to verify if an implementation is compliant or not.
Ie, for each operator there are a number of testcases that provides input data and are used to validate the output.
The total amount of operators needed is not that large, probably around 20, maybe even less.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a non complete comparison - have a look at what we specified in the Ikea procedural prototypes
This is not the complete declaration but it's enough to show the differences in design:
Food for thought! Perhaps it's better to make this into a vendor extension (remove KHR prefix) and rename to That way you would be able to keep the current design, if the extension receives traction it can be made into a KHR extension in the future. What do you think? |
Thanks for the fix.
… comes from the nodes. Inputs on nodes can be aniated. Further discussion on defails on existing extension required. Explicit note N:M graph -> material bindings possible.
* KHR_materials_ior: Minor typo: plural instead of singular (#2413) * Update anisotropy extension spec (#2409) * Clarify and simplify formula for attenuation. (#2414) * Add TRACE prefix (#2417) * Update clearcoat extension spec (#2415) * Update README. (#2427) * Add KHR_node_hoverability (#2428) * Add KHR_node_hoverability * Resort extension list * EXT_mesh_gpu_instancing: Suggest extensionRequired usage (#2405) * Add button/link to glTF Discord (#2429) As there is a lot more traffic to the Khronos glTF Discord than there is to Slack, a button pointing users to Discord will be helpful. --------- Co-authored-by: Andreas Atteneder <andreas.atteneder@unity3d.com> Co-authored-by: Alexey Knyazev <3479527+lexaknyazev@users.noreply.github.com> Co-authored-by: Ed Mackey <elm19087@gmail.com> Co-authored-by: Marco Hutter <javagl@javagl.de> Co-authored-by: Khronos Group Web Services <webservices@khronosgroup.org> Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com> Co-authored-by: James Riordon <outofcontrol@users.noreply.github.com>
Change max from 4 to 16 for data vector so 3x3 and 4x4 matrices can be supported.
The only thing I think confusing is if this is a procedural texture for generating images to act as textures in existing materials (like your edits suggest) or is this for full procedural MATERIALS. I will say, they way it is being advertised and promoted in the blogs and talks like Siggraph is as a procedural material, particularly as a channel for MaterialX materials. One of the major goals listed for 2025 was to maintain good relations/interoperability with USD which uses MaterialX. The way the extension is written now is different procedural systems could be used, be it other MatX versions or future systems like THREE TSL to generate the graph. IMO the ship has sailed on this being texture only, and as it's a core goal I think the KHR name would stick. perhaps PS if this is an old idea discussed elsewhere I apologize, it's hard finding the right channels to discuss these things. |
Draft Proposal for
KHR_texture_procedurals
JSON
Schema is still progress.