-
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
|
||
## Dependencies | ||
|
||
Written against the glTF 2.0 spec. |
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.
Should MaterialX 1.39 spec be added as a dependency.
|
||
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.
MaterialX "1.39" specification
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.
Second extension will be written against gltf 2.0 and KHR_procedural
|
||
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 support NPR effects for 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.
"Provide the ability to support NPR effects for unlit materials" - is this required?
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 can be changed to say that you can map to a "unlit" material in glTF. So NPR can be removed in mapping procedural textures to unlit.
```json | ||
{ | ||
"extensions": { | ||
"KHR_texture_procedurals": { | ||
"mimetype": "application/mtlx+json;version=<MaterialX_version>", | ||
"procedurals": [] | ||
} | ||
} | ||
} |
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.
Following up from last call, proposed change is to simply mention
"extensions": {
"KHR_texture_procedurals"
}
Which indicates that gltf texture procedural "structure" is used.
When gltf texture procedural uses MaterialX 1.39 nodes the extension will be
"extensions":
"KHR_texture_procedurals_MaterialX_1.39": {
}
Example usage:
"extensionsRequired" : [
"KHR_texture_procedurals"
]
"extensionsUsed" : [
"KHR_texture_procedurals_MaterialX_1.39"
]
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.
use case #1 gltf using Mtlx 1.39
extensionsRequired" : [
"KHR_texture_procedurals"
"KHR_texture_procedurals_MaterialX_1.39"
]
use case #2 gltf using Mtlx 2.0
extensionsRequired" : [
"KHR_texture_procedurals"
"KHR_texture_procedurals_MaterialX_2.00"
]
use case #3
extensionsRequired" : [
"KHR_texture_procedurals"
"NV_MDL_texture_procedurals"
]
(mixing of procedurals is not allowed, only one node library can be used at a time)
extensionsRequired" : [
"KHR_texture_procedurals"
"KHR_texture_procedurals_MaterialX_1.39"
"KHR_texture_procedurals_MaterialX_2.00"
]
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.
What does it mean to include NV_MDL_texture_procedurals
is there some co-dependency implied here or just an example ?
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.
What does the extenions
portion look like. Is it still this ?
{
"extensions": {
"KHR_texture_procedurals": {
"procedurals": []
}
}
}
Or do you need something like this ?
{
"extensions": {
"KHR_texture_procedurals_MaterialX_1.39": {
"procedurals": []
}
}
}
``` | ||
It is assumed that a mimetype is always required. As part of the mimetype a version `<MaterialX_version>` is specified. This is the version of the MaterialX library specification used when writing to glTF. The version is specified as a string in the form of `<major version>.<minor version>`. For example, if the MaterialX library version is 1.39, the mimetype would be `application/mtlx+json;version=1.39`. | ||
|
||
The correspond version is specified in a MaterialX XML document as follows: | ||
|
||
```xml | ||
<materialx version="1.39"> | ||
</materialx> | ||
``` | ||
|
||
The version in the mimetype __is not__ the extension version. If in the future the schema needs to be modified (perhaps due to changes in MaterialX) then a new extension version would be required. | ||
|
||
The `procedurals` array specifies the procedural graphs that are used in the glTF asset. | ||
|
||
### Versioning | ||
|
||
Elements from different versions of MaterialX is disallowed. External tooling must handle this (e.g. by performing an "upgrade" operation). | ||
|
||
<img src="./figures//version_upgrade.svg" width=100%> | ||
|
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 section can be removed since use of KHR_texture_procedurals + KHR_texture_procedurals_MaterialX_1.39 will imply MaterialX library used.
```json | ||
{ | ||
"extensions": { | ||
"KHR_texture_procedurals_MaterialX_1.39": { |
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.
Is this the correct usage ? i.e. the extension is hard-coded to a version ?
Draft Proposal for
KHR_texture_procedurals
JSON
Schema is still progress.