Skip to content
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

NV_materials_mdl #2288

Merged
merged 6 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
503 changes: 503 additions & 0 deletions extensions/2.0/Vendor/NV_materials_mdl/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$id": "bsdfMeasurement.schema.json",
"title": "BSDF Measurement",
"type": "object",
"description": "A BSDF measurement (MBSDF) as defined in the MDL Language Specification.",
"allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],
"properties": {
"uri": {
"type": "string",
"description": "The URI (or IRI) of the MBSDF.",
"format": "iri-reference",
"gltf_detailedDescription": "The URI (or IRI) of the MBSDF. Relative paths are relative to the current glTF asset. Instead of referencing an external file, this field **MAY** contain a `data:`-URI. This field **MUST NOT** be defined when `bufferView` is defined."
},
"bufferView": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The ID of the bufferView containing the MBSDF. This field **MUST NOT** be defined if `uri` is defined."
},
"name": { },
"extensions": { },
"extras": { }
},
"oneOf": [
{ "required": [ "uri" ] },
{ "required": [ "bufferView" ] }
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$id": "functionCall.argument.schema.json",
"title": "Function Call Argument",
"type": "object",
"description": "Named function call argument. Can be another function call or a constant value.",
"allOf": [ { "$ref" : "glTFProperty.schema.json" } ],
"properties": {
"name": {
tblutNV marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"minLength": 1,
"description": "The name of the named argument."
},
"type": {
"allOf": [ { "$ref": "functionCall.type.schema.json" } ],
"description": "The type of the value argument. This field **MUST** be defined if `value` is defined and **MUST NOT** be defined if `functionCall` is defined."
},
"functionCall": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The ID of a function call. This field **MUST NOT** be defined if `value` is defined."
},
"value": {
"anyOf": [
{ "type": "boolean" },
{ "type": "integer" },
{ "type": "number" },
{ "type": "string" },
{
"type": "array",
"items": {
"anyOf": [
{ "type": "boolean" },
{ "type": "integer" },
{ "type": "number" }
]
},
"minItems": 2,
"maxItems": 4
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 16
},
{
"type": "array",
tblutNV marked this conversation as resolved.
Show resolved Hide resolved
"items": {
"anyOf": [
{ "type": "boolean" },
{ "type": "integer" },
{ "type": "number" },
{ "type": "string" },
{
"type": "array",
"items": {
"anyOf": [
{ "type": "boolean" },
{ "type": "integer" },
{ "type": "number" }
]
},
"minItems": 2,
"maxItems": 4
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 16
}
]
}
}
],
"description": "The literal value of the value argument. This field **MUST NOT** be defined if `functionCall` is defined."
},
"extensions": { },
"extras": { }
},
"dependencies": {
"value": [ "type" ]
},
"oneOf": [
{ "required": [ "name", "functionCall" ] },
{ "required": [ "name", "value" ] }
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$id": "functionCall.schema.json",
"title": "Function Call",
"type": "object",
"description": "Function call with its list of arguments. Can represent the entry point into a function call graph or be a node in such a graph.",
"allOf": [ { "$ref" : "glTFChildOfRootProperty.schema.json" } ],
"properties": {
"module": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The ID of the containing module. This field **MUST NOT** be defined if a built-in function is specified."
},
"functionName": {
"type": "string",
lexaknyazev marked this conversation as resolved.
Show resolved Hide resolved
"minLength": 1,
"description": "The unqualified name of the function."
},
"type": {
"allOf": [ { "$ref": "functionCall.type.schema.json" } ],
"description": "The return type of the function."
},
"arguments": {
"type": "array",
"items": {
"$ref": "functionCall.argument.schema.json"
},
"minItems": 1,
"description": "A list of named value and/or function call arguments. Multiple arguments with the same name **MUST NOT** exist."
},
"name": { },
"extensions": { },
"extras": { }
},
"required": [
"functionName",
"type"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$id": "functionCall.type.schema.json",
"title": "Type",
"type": "object",
"description": "MDL type describing either a built-in or user-defined type, or an array of a built-in or user-defined type.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"module": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The ID of the containing module. This field **MUST NOT** be defined if a built-in type is specified."
},
"typeName": {
"type": "string",
lexaknyazev marked this conversation as resolved.
Show resolved Hide resolved
"minLength": 1,
"description": "The unqualified name of the type."
},
"arraySize": {
"type": "integer",
"minimum": 0,
"description": "The array size. If this field is defined the type is considered to be a array."
},
"modifier": {
"anyOf": [
{
"type": "string",
"const": ""
},
{
"type": "string",
"const": "varying"
},
{
"type": "string",
"const": "uniform"
},
{
"type": "string"
lexaknyazev marked this conversation as resolved.
Show resolved Hide resolved
}
],
"default": "",
"description": "The name of the type modifier."
},
"extensions": { },
"extras": { }
},
"required": [
"typeName"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$id": "glTF.NV_materials_mdl.schema.json",
"title": "NV_materials_mdl glTF extension",
"type": "object",
"description": "glTF extension that enables using MDL materials.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"modules": {
"type": "array",
"items": {
"$ref": "module.schema.json"
},
"minItems": 1,
"description": "The list of all MDL modules."
},
"functionCalls": {
"type": "array",
"items": {
"$ref": "functionCall.schema.json"
},
"minItems": 1,
"description": "The list of all function calls."
},
"bsdfMeasurements": {
"type": "array",
"items": {
"$ref": "bsdfMeasurement.schema.json"
},
"minItems": 1,
"description": "The list of all BSDF measurements."
},
lexaknyazev marked this conversation as resolved.
Show resolved Hide resolved
"extensions": {},
"extras": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$id": "material.NV_materials_mdl.schema.json",
"title": "NV_materials_mdl material extension",
"type": "object",
"description": "glTF extension that enables using MDL materials.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"functionCall": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The index of the MDL function call. The reference function call **MUST** represent the entry point to a function call graph and have the return type `material`."
},
"extensions": { },
"extras": { }
},
"required": [
"functionCall"
]
}
34 changes: 34 additions & 0 deletions extensions/2.0/Vendor/NV_materials_mdl/schema/module.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$id": "module.schema.json",
"title": "Module",
"type": "object",
"description": "An MDL module.",
"allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],
"properties": {
"uri": {
"type": "string",
"description": "The URI (or IRI) of the MDL module.",
"format": "iri-reference",
"gltf_detailedDescription": "The URI (or IRI) of the MDL module. Relative paths are relative to the current glTF asset. Instead of referencing an external file, this field **MAY** contain a `data:`-URI. This field **MUST NOT** be defined when `bufferView` is defined."
},
"bufferView": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The ID of the bufferView containing the MDL module. This field **MUST NOT** be defined if `uri` is defined."
},
"modulePath": {
"type": "string",
"description": "Relative path of the module. This field **MUST** be defined if `bufferView` is defined or `uri` is defined and contains a data-URI, otherwise this field **MUST NOT** be defined."
},
"name": { },
"extensions": { },
"extras": { }
},
"dependencies": {
"bufferView": [ "modulePath" ]
},
"oneOf": [
{ "required": [ "uri" ] },
{ "required": [ "bufferView" ] }
]
}
1 change: 1 addition & 0 deletions extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Vendor extensions are not covered by the Khronos IP framework.
* [MSFT_packing_normalRoughnessMetallic](2.0/Vendor/MSFT_packing_normalRoughnessMetallic/README.md)
* [MSFT_packing_occlusionRoughnessMetallic](2.0/Vendor/MSFT_packing_occlusionRoughnessMetallic/README.md)
* [MSFT_texture_dds](2.0/Vendor/MSFT_texture_dds/README.md)
* [NV_materials_mdl](2.0/Vendor/NV_materials_mdl/README.md)

### Archived Extensions for glTF 2.0

Expand Down