Skip to content

Commit

Permalink
Merge pull request #224 from aaronfranke/schema-2020-12
Browse files Browse the repository at this point in the history
Upgrade schemas to draft 2020-12
  • Loading branch information
antpb authored Jul 11, 2024
2 parents 683da97 + b8f8aeb commit 35cd3a3
Show file tree
Hide file tree
Showing 58 changed files with 494 additions and 512 deletions.
2 changes: 1 addition & 1 deletion extensions/2.0/Archived/OMI_collider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Trigger shapes are not solid to other objects and will not collide with them. Tr

### JSON Schema

See [schema/collider.schema.json](schema/collider.schema.json) for the main collider schema, [schema/glTF.OMI_collider.schema.json](schema/glTF.OMI_collider.schema.json) for the document-level list of colliders, and [schema/node.OMI_collider.schema.json](schema/node.OMI_collider.schema.json) for the node-level collider selection.
See [schema/glTF.OMI_collider.collider.schema.json](schema/glTF.OMI_collider.collider.schema.json) for the main collider schema, [schema/glTF.OMI_collider.schema.json](schema/glTF.OMI_collider.schema.json) for the document-level list of colliders, and [schema/node.OMI_collider.schema.json](schema/node.OMI_collider.schema.json) for the node-level collider selection.

## Known Implementations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.OMI_collider.collider.schema.json",
"title": "OMI_collider Collider",
"type": "object",
"required": [
"type"
],
"description": "Parameters describing a collider physics shape.",
"allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],
"properties": {
"type": {
"type": "string",
Expand All @@ -23,9 +23,13 @@
"description": "When true this collider will not be solid to physics bodies in the scene, and instead the shape will act as a trigger detection area.",
"default": false
},
"name": { },
"extensions": { },
"extras": { }
},
"required": [
"type"
],
"oneOf": [
{
"required": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.OMI_collider.schema.json",
"title": "OMI_collider glTF Document Extension",
"type": "object",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"description": "Top level collider resources.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"colliders": {
"description": "An array of colliders that can be referenced by nodes.",
"type": "array",
"items": {
"type": "object",
"$ref": "collider.schema.json"
"$ref": "glTF.OMI_collider.collider.schema.json"
},
"minItems": 1
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "node.OMI_collider.schema.json",
"title": "OMI_collider glTF Node Extension",
"type": "object",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"description": "Node extension that references a collider.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"collider": {
"description": "The id of the collider referenced by this node.",
"allOf": [
{
"$ref": "glTFid.schema.json"
}
]
"allOf": [{"$ref": "glTFid.schema.json"}],
"description": "The id of the collider referenced by this node."
},
"extensions": {},
"extras": {}
Expand Down
2 changes: 1 addition & 1 deletion extensions/2.0/KHR_audio_emitter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ Radians are used for angles matching glTF2.

### JSON Schema

[glTF.KHR_audio_emitter.schema.json](/extensions/2.0/KHR_audio_emitter/schema/glTF.KHR_audio_emitter.schema.json)
See [glTF.KHR_audio_emitter.schema.json](schema/glTF.KHR_audio_emitter.schema.json) for the main document-level schema.

## Known Implementations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.KHR_audio_emitter.audio.schema.json",
"title": "KHR_audio_emitter Audio Data",
"type": "object",
"description": "Audio data objects define where audio data is located and what format the data is in. The data is either accessed via a bufferView or uri. `mimeType` is required when `bufferView` is used.",
"allOf": [{ "$ref": "glTFProperty.schema.json" }],
"allOf": [{ "$ref": "glTFChildOfRootProperty.schema.json" }],
"properties": {
"uri": {
"type": "string",
Expand All @@ -17,10 +18,10 @@
"description": "The audio's MIME type. Required if `bufferView` is defined. Unless specified by another extension, the only supported mimeTypes are `audio/mpeg` and `audio/wav`.",
"anyOf": [
{
"enum": ["audio/mpeg"]
"const": "audio/mpeg"
},
{
"enum": ["audio/wav"]
"const": "audio/wav"
},
{
"type": "string"
Expand All @@ -35,7 +36,7 @@
"extensions": {},
"extras": {}
},
"dependencies": {
"dependentRequired": {
"bufferView": ["mimeType"]
},
"oneOf": [{ "required": ["uri"] }, { "required": ["bufferView"] }]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.KHR_audio_emitter.emitter.positional.schema.json",
"title": "KHR_audio_emitter Positional Audio Emitter",
"type": "object",
"description": "Positional audio emitter properties.",
"allOf": [{ "$ref": "glTFProperty.schema.json" }],
"properties": {
"coneInnerAngle": {
"description": "The angle, in radians, of a cone inside of which there will be no volume reduction. This angle represents the angular diameter of the cone, from side to side. If not specified, the angle of Tau radians (360 degrees) is used, which means the audio emits in all directions (not in a cone).",
"type": "number",
"description": "The angle, in radians, of a cone inside of which there will be no volume reduction. This angle represents the angular diameter of the cone, from side to side. If not specified, the angle of Tau radians (360 degrees) is used, which means the audio emits in all directions (not in a cone).",
"minimum": 0.0,
"maximum": 6.2831853071795864,
"default": 6.2831853071795864
},
"coneOuterAngle": {
"description": "The angle, in radians, of a cone outside of which the volume will be reduced to a constant value of `coneOuterGain`. This angle represents the angular diameter of the cone, from side to side. If not specified, the angle of Tau radians (360 degrees) is used, which means some audio will emit in all directions.",
"type": "number",
"description": "The angle, in radians, of a cone outside of which the volume will be reduced to a constant value of `coneOuterGain`. This angle represents the angular diameter of the cone, from side to side. If not specified, the angle of Tau radians (360 degrees) is used, which means some audio will emit in all directions.",
"minimum": 0.0,
"maximum": 6.2831853071795864,
"default": 6.2831853071795864
},
"coneOuterGain": {
"description": "The linear volume gain of the audio emitter set when outside the cone defined by the `coneOuterAngle` property. It is a linear value (not dB). If not specified, the cone outer gain is `0.0`, meaning the audio will be silent outside of the cone.",
"type": "number",
"description": "The linear volume gain of the audio emitter set when outside the cone defined by the `coneOuterAngle` property. It is a linear value (not dB). If not specified, the cone outer gain is `0.0`, meaning the audio will be silent outside of the cone.",
"minimum": 0.0,
"default": 0.0
},
Expand All @@ -30,31 +31,30 @@
"description": "Specifies the distance model for the audio emitter.",
"anyOf": [
{
"enum": ["linear"],
"const": "linear",
"description": "A linear distance model calculating the gain induced by the distance according to: 1.0 - rolloffFactor * (distance - refDistance) / (maxDistance - refDistance)"
},
{
"enum": ["inverse"],
"const": "inverse",
"description": "An inverse distance model calculating the gain induced by the distance according to: refDistance / (refDistance + rolloffFactor * (Math.max(distance, refDistance) - refDistance))"
},
{
"enum": ["exponential"],
"const": "exponential",
"description": "An exponential distance model calculating the gain induced by the distance according to: pow((Math.max(distance, refDistance) / refDistance, -rolloffFactor))"
}
],
"default": "inverse"
},
"maxDistance": {
"description": "The maximum distance between the emitter and listener, after which the volume will not be reduced any further. If zero or not specified, the audio emitter does not have a maximum distance, and it can be heard from any distance.",
"type": "number",
"description": "The maximum distance between the emitter and listener, after which the volume will not be reduced any further. If zero or not specified, the audio emitter does not have a maximum distance, and it can be heard from any distance.",
"minimum": 0.0,
"default": 0.0
},
"refDistance": {
"description": "A reference distance for reducing volume as the emitter moves further from the listener. For distances less than this, the volume is not reduced. This value cannot be zero or a negative number. If not specified, the default value is `1.0`.",
"type": "number",
"minimum": 0.0,
"exclusiveMinimum": true,
"description": "A reference distance for reducing volume as the emitter moves further from the listener. For distances less than this, the volume is not reduced. This value cannot be zero or a negative number. If not specified, the default value is `1.0`.",
"exclusiveMinimum": 0.0,
"default": 1.0
},
"rolloffFactor": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.KHR_audio_emitter.emitter.schema.json",
"title": "KHR_audio_emitter Audio Emitter",
"type": "object",
"description": "Audio emitters define how audio sources are played back. Emitter properties are defined at the document level and are references by nodes. Audio may be played globally or positionally. Positional audio has further properties that define how audio volume scales with distance and angle.",
"allOf": [{ "$ref": "glTFProperty.schema.json" }],
"allOf": [{ "$ref": "glTFChildOfRootProperty.schema.json" }],
"properties": {
"type": {
"type": "string",
"description": "Specifies the audio emitter type.",
"anyOf": [
{
"enum": ["global"],
"const": "global",
"description": "Global audio emitters are not affected by the position of audio listeners. All `positional` properties may not be defined on global audio emitters."
},
{
"enum": ["positional"],
"const": "positional",
"description": "Positional audio emitters play audio at a position in the scene. The properties are defined in the `positional` object."
},
{
Expand All @@ -23,23 +24,21 @@
]
},
"gain": {
"description": "Unitless linear multiplier against original source volume for determining emitter loudness.",
"type": "number",
"description": "Unitless linear multiplier against original source volume for determining emitter loudness.",
"minimum": 0.0,
"default": 1.0
},
"sources": {
"description": "An array of audio source indices used by the audio emitter. This array may be empty.",
"type": "array",
"allOf": [
{
"$ref": "glTFid.schema.json"
}
]
"description": "An array of audio source indices used by the audio emitter. This array may be empty.",
"items": {
"allOf": [ { "$ref": "glTFid.schema.json" } ]
}
},
"positional": {
"type": "object",
"$ref": "emitter.positional.schema.json"
"$ref": "glTF.KHR_audio_emitter.emitter.positional.schema.json"
},
"name": {},
"extensions": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.KHR_audio_emitter.schema.json",
"title": "KHR_audio_emitter glTF Document Extension",
"type": "object",
"description": "Top level audio properties and resources.",
"allOf": [{ "$ref": "glTFProperty.schema.json" }],
"properties": {
"sources": {
"description": "An array of audio sources to be used in audio emitters.",
"type": "array",
"description": "An array of audio sources to be used in audio emitters.",
"items": {
"type": "object",
"$ref": "source.schema.json"
"$ref": "glTF.KHR_audio_emitter.source.schema.json"
},
"minItems": 1
},
"emitters": {
"description": "An array of positional or global audio emitters that can be referenced by nodes or scenes.",
"type": "array",
"description": "An array of positional or global audio emitters that can be referenced by nodes or scenes.",
"items": {
"type": "object",
"$ref": "emitter.schema.json"
"$ref": "glTF.KHR_audio_emitter.emitter.schema.json"
},
"minItems": 1
},
"audio": {
"description": "An array of audio that can be referenced by nodes.",
"type": "array",
"description": "An array of audio that can be referenced by nodes.",
"items": {
"type": "object",
"$ref": "audio.schema.json"
"$ref": "glTF.KHR_audio_emitter.audio.schema.json"
},
"minItems": 1
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.KHR_audio_emitter.source.schema.json",
"title": "KHR_audio_emitter Audio Source",
"type": "object",
"description": "Audio sources reference audio data and define playback properties for it. Audio sources may be used by zero to many audio emitters.",
"allOf": [{ "$ref": "glTFProperty.schema.json" }],
"allOf": [{ "$ref": "glTFChildOfRootProperty.schema.json" }],
"properties": {
"autoPlay": {
"description": "Whether or not to play the specified audio when the glTF is loaded.",
"type": "boolean",
"description": "Whether or not to play the specified audio when the glTF is loaded.",
"default": false
},
"gain": {
"description": "Unitless multiplier against original audio file volume for determining audio source loudness.",
"type": "number",
"description": "Unitless multiplier against original audio file volume for determining audio source loudness.",
"minimum": 0.0,
"default": 1.0
},
"loop": {
"description": "Whether or not to loop the specified audio when finished.",
"type": "boolean",
"description": "Whether or not to loop the specified audio when finished.",
"default": false
},
"audio": {
"description": "The index of the audio data assigned to this clip.",
"allOf": [
{
"$ref": "glTFid.schema.json"
}
]
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The index of the audio data assigned to this clip."
},
"name": {},
"extensions": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "node.KHR_audio_emitter.schema.json",
"title": "KHR_audio_emitter glTF Node Extension",
"type": "object",
"description": "Node extension that references an audio emitter.",
"allOf": [{ "$ref": "glTFProperty.schema.json" }],
"properties": {
"emitter": {
"description": "The id of the positional audio emitter referenced by this node.",
"allOf": [
{
"$ref": "glTFid.schema.json"
}
]
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The id of the audio emitter referenced by this node."
},
"extensions": {},
"extras": {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "scene.KHR_audio_emitter.schema.json",
"title": "KHR_audio_emitter glTF Scene Extension",
"type": "object",
"description": "Scene extension that references global audio emitters.",
"allOf": [{ "$ref": "glTFProperty.schema.json" }],
"properties": {
"emitters": {
"type": "array",
"description": "The indices of each global audio emitter. Positional audio emitters may not be added to the scene node.",
"items": {
"$ref": "glTFid.schema.json"
"allOf": [ { "$ref": "glTFid.schema.json" } ]
},
"uniqueItems": true,
"minItems": 1
Expand Down
4 changes: 4 additions & 0 deletions extensions/2.0/OMI_audio_ogg_vorbis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ If a glTF contains an audio source using Ogg Vorbis audio with no fallback audio

If a glTF contains an audio source using Ogg Vorbis audio with no fallback audio data, and `KHR_audio_emitter` is not a required extension, then do not add `OMI_audio_ogg_vorbis` to `extensionsRequired`. Clients supporting `KHR_audio_emitter` but not `OMI_audio_ogg_vorbis` will consider the lack of `"audio"` in a `KHR_audio_emitter` source to be an error, and either will not be able to play audio from that source, or will not load the `KHR_audio_emitter` extension.

### JSON Schema

See [schema/glTF.KHR_audio_emitter.source.OMI_audio_ogg_vorbis.schema.json](schema/glTF.KHR_audio_emitter.source.OMI_audio_ogg_vorbis.schema.json) for the schema.

## Known Implementations

None
Expand Down
Loading

0 comments on commit 35cd3a3

Please sign in to comment.