Skip to content

Commit 63cc8e6

Browse files
committed
Update versioned extension declaration syntax.
1 parent a12b0ed commit 63cc8e6

File tree

1 file changed

+26
-23
lines changed
  • extensions/2.0/Khronos/KHR_texture_procedurals

1 file changed

+26
-23
lines changed

extensions/2.0/Khronos/KHR_texture_procedurals/README.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Textures represented as procedural graphs provides a way to extend the capabilit
5757

5858
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.
5959

60-
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.
60+
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.
6161

6262
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.
6363

@@ -93,7 +93,7 @@ The following is a set of definitions using MaterialX nomenclature to provide co
9393

9494
## Extension Declaration
9595

96-
Usage is indicated by adding the `KHR_texture_procedurals` extension identifier to the `extensionsUsed` array.
96+
Usage of the procedural structure is indicated by adding the `KHR_texture_procedurals` extension identifier to the `extensionsUsed` array.
9797

9898
```json
9999
{
@@ -102,36 +102,39 @@ Usage is indicated by adding the `KHR_texture_procedurals` extension identifier
102102
]
103103
}
104104
```
105-
with the extension object defined in the `extensions array:
105+
To indicate the usage of a specific set of definitions an additional entry must be added to `extensionsUsd`. For example usage of definitions from a version of the MaterialX would look like this:
106+
```json
107+
{
108+
"extensionsUsed": [
109+
"KHR_texture_procedurals"
110+
"KHR_texture_procedurals_MaterialX_<version>"
111+
]
112+
}
113+
```
114+
where `<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 extension string would be: `KHR_texture_procedurals_MaterialX_1.39`.
106115

116+
Note that two versions of the same library **cannot** be used in the same glTF asset. For example the following is considered to be invalid:
117+
```json
118+
{
119+
"extensionsUsed": [
120+
"KHR_texture_procedurals"
121+
"KHR_texture_procedurals_MaterialX_1.39"
122+
"KHR_texture_procedurals_MaterialX_2.0>"
123+
]
124+
}
125+
```
126+
127+
Usage of a given extension is defined in the `extensions` object as follows:
107128
```json
108129
{
109130
"extensions": {
110-
"KHR_texture_procedurals": {
111-
"mimetype": "application/mtlx+json;version=<MaterialX_version>",
131+
"KHR_texture_procedurals_MaterialX_1.39": {
112132
"procedurals": []
113133
}
114134
}
115135
}
116136
```
117-
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`.
118-
119-
The correspond version is specified in a MaterialX XML document as follows:
120-
121-
```xml
122-
<materialx version="1.39">
123-
</materialx>
124-
```
125-
126-
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.
127-
128-
The `procedurals` array specifies the procedural graphs that are used in the glTF asset.
129-
130-
### Versioning
131-
132-
Elements from different versions of MaterialX is disallowed. External tooling must handle this (e.g. by performing an "upgrade" operation).
133-
134-
<img src="./figures//version_upgrade.svg" width=100%>
137+
The `procedurals` array specifies the procedural graphs for a given set of nodes that are used in the glTF asset.
135138

136139
## Representation
137140

0 commit comments

Comments
 (0)