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

Update KHR_light_punctual schema from json schema draft 04 to json schema draft 2020-12 #2379

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Update KHR_light_punctual schema from json schema draft 04 to json sc…
…hema draft 2020-12
  • Loading branch information
teddemunnik committed Apr 2, 2024
commit b8a1ebd052b21458e88fff35ac1d0f2d3bcb0e46
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.KHR_lights_punctual.schema.json",
"title": "KHR_lights_punctual glTF Document Extension",
"type": "object",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "light.schema.json",
"title": "KHR_lights_punctual Light Properties",
"type": "object",
"description": "A directional, point, or spot light.",
Expand Down Expand Up @@ -32,15 +33,15 @@
"description": "Specifies the light type.",
"anyOf": [
{
"enum": [ "directional" ],
"const": "directional",
"description": "Directional lights act as though they are infinitely far away and emit light in the direction of the local -z axis. This light type inherits the orientation of the node that it belongs to; position and scale are ignored except for their effect on the inherited node orientation. Because it is at an infinite distance, the light is not attenuated. Its intensity is defined in lumens per metre squared, or lux (lm/m^2)."
},
{
"enum": [ "point" ],
"const": "point",
"description": "Point lights emit light in all directions from their position in space; rotation and scale are ignored except for their effect on the inherited node position. The brightness of the light attenuates in a physically correct manner as distance increases from the light's position (i.e. brightness goes like the inverse square of the distance). Point light intensity is defined in candela, which is lumens per square radian (lm/sr)."
},
{
"enum": [ "spot" ],
"const": "spot",
"description": "Spot lights emit light in a cone in the direction of the local -z axis. The angle and falloff of the cone is defined using two numbers, the innerConeAngle and outerConeAngle. As with point lights, the brightness also attenuates in a physically correct manner as distance increases from the light's position (i.e. brightness goes like the inverse square of the distance). Spot light intensity refers to the brightness inside the innerConeAngle (and at the location of the light) and is defined in candela, which is lumens per square radian (lm/sr). Engines that don't support two angles for spotlights should use outerConeAngle as the spotlight angle (leaving innerConeAngle to implicitly be 0)."
},
{
Expand All @@ -51,8 +52,7 @@
"range": {
"type": "number",
"description": "A distance cutoff at which the light's intensity may be considered to have reached zero.",
"minimum": 0,
"exclusiveMinimum": true
"exclusiveMinimum": 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Since this value is not restricted to integers, I would prefer 0.0 instead of just 0, to make it clear to readers. This would also be consistent with other values.

Same for light.spot.schema.json.

},
"name": { },
"extensions": { },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema" : "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "light.spot.schema.json",
"title" : "KHR_lights_punctual Light Spot Properties",
"type" : "object",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
Expand All @@ -9,16 +10,14 @@
"description" : "Angle in radians from centre of spotlight where falloff begins.",
"default" : 0.0,
"minimum": 0,
"maximum": 1.5707963267948966,
"exclusiveMaximum": true
"exclusiveMaximum": 1.5707963267948966
},
"outerConeAngle" : {
"type" : "number",
"description" : "Angle in radians from centre of spotlight where falloff ends.",
"default" : 0.7853981633974483,
"minimum": 0,
"maximum": 1.5707963267948966,
"exclusiveMinimum": true
"exclusiveMinimum": 0,
"maximum": 1.5707963267948966
},
"extensions": { },
"extras": { }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "node.KHR_lights_punctual.schema.json",
"title": "KHR_lights_punctual glTF Node Extension",
"type": "object",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
Expand Down