diff --git a/extensions/Khronos/KHR_materials_common/README.md b/extensions/Khronos/KHR_materials_common/README.md index 054c5ee47c..7f1db940ad 100644 --- a/extensions/Khronos/KHR_materials_common/README.md +++ b/extensions/Khronos/KHR_materials_common/README.md @@ -3,99 +3,107 @@ ## Contributors * Tony Parisi, WEVR, [@auradeluxe](https://twitter.com/auradeluxe), +* Robert Taglang, Cesium, [@lasalvavida](https://github.com/lasalvavida) ## Status -Draft (not ratified yet) +Draft ## Dependencies -Written against the glTF draft 1.0 spec. +Written against the glTF draft 2.0 spec. ## Overview -This extension defines a set of common materials and lights for use with glTF. +glTF uses Physically-Based Rendering (PBR) to define its materials. The renderer is usually responsible for deciding how to shade the material. This extension defines several common lighting models which can be used to force the renderer to conform to a particular shading technique. -glTF does not define a lighting model, instead relegating shading of visuals to GLSL shader code defined within techniques in the glTF file. For many use cases, it is desirable to shade visuals with commonly understood and implemented shading techniques, such as Blinn and Lambert. - -Many 3D tools and WebGL runtimes support built-in implementations of common material and light types. Using this extension, tools can export a much more compact representation of materials and lights. In addition, a runtimes with built-in lighting can apply its built-in light values to visuals shaded with common materials found in the glTF file. - -This extension defines four light types: `directional`, `point`, `spot`, and `ambient`; and the material types `blinn`, `phong`, `lambert` and `constant`, for Blinn, Phong, Lambert and Unlit ("constant" color) materials, respectively. - -The [conformance](#conformance) section specifies what an implementation must to do when encountering this extension, and how the extension interacts with the materials defined in the base specification. +This extension defines the material types `BLINN`, `PHONG`, `LAMBERT` and `CONSTANT`, for Blinn, Phong, Lambert and Unlit ("constant" color) materials, respectively. ## Materials ### Extending Materials -Common materials are defined by adding an `extensions` property to any glTF material, and defining its `KHR_materials_common` property. Each material has two properties: `technique`, which specifies the shading technique used e.g. `BLINN`, and `values` which contains a set of technique-specific values. +Common materials are defined by adding a `KHR_materials_common` property to the `extensions` object for the material. The extension defines a `technique` property to specify the lighting model. -For example, the following defines a material with a Lambert shader with 50% gray diffuse color: +For example, the following defines a material with a Lambert shader with 50% base color: ```javascript -"materials": { - "lambert1": { - "extensions": { +"materials": [ + { + "pbrMetallicRoughness" : { + "baseColorFactor" : [0.5, 0.5, 0.5, 1.0] + }, + "extensions" : { "KHR_materials_common" : { - // one of CONSTANT, - // BLINN, - // PHONG, - // LAMBERT - "technique" : "LAMBERT", - "values": { - "diffuse": [ - 0.5, - 0.5, - 0.5, - 1 - ] - } + "technique" : 2 // lambert } } } -} +] ``` ### Material Types -#### Common Material Shared Properties +The `technique` property is assigned a value from the enum of material types. Table 1 lists the enum values used for each lighting model. -Table 1 lists properties that can appear in the `values` property of a common material, and that are shared among several of the common material types. +Table 1. Material Type Enumeration -Table 1. Common Material Shared Properties +| Material Type | Value | +|:-------------:|:-----:| +| `BLINN` | 0 | +| `PHONG` | 1 | +| `LAMBERT` | 2 | +| `CONSTANT` | 3 | -| Property | Type | Description | Default Value | Applies To | -|:----------------------------:|:------------:|:-----------:|:-------------:|:----------:| -| `ambient` | `FLOAT_VEC4` | RGBA value for ambient light reflected from the surface of the object.|[0,0,0,1] | `BLINN`, `PHONG`, `LAMBERT`, `CONSTANT` | -| `diffuse` | `FLOAT_VEC4` or string | RGBA value or texture ID defining the amount of light diffusely reflected from the surface of the object. | [0,0,0,1] | `BLINN`, `PHONG`, `LAMBERT` | -| `doubleSided` | `boolean` | Declares whether backface culling should be disabled for this visual. Corresponds to disabling the `CULL_FACE` render state. | `false` | | -| `emission` | `FLOAT_VEC4` or string | RGBA value or texture ID for light emitted by the surface of the object. | [0,0,0,1] | `BLINN`, `PHONG`, `LAMBERT`, `CONSTANT` | -| `specular` | `FLOAT_VEC4` or string | RGBA value or texture ID defining the color of light specularly reflected from the surface of the object. | [0,0,0,1] | `BLINN`, `PHONG` | -| `shininess` | `FLOAT` | Defines the specularity or roughness of the specular reflection lobe of the object. | 0.0 | `BLINN`, `PHONG` | -| `transparency` | `FLOAT` | Declares the amount of transparency as an opacity value between 0.0 and 1.0. | 1.0 | `BLINN`, `PHONG`, `LAMBERT`, `CONSTANT` | -| `transparent` | `boolean` | Declares whether the visual should be rendered using alpha blending. Corresponds to enabling the `BLEND` render state, setting the `depthMask` property to `false`, and defining blend equations and blend functions as described in the implementation note. | `false` | | +### Material Parameters -> **Implementation Note**: An implementation should render alpha-blended visuals in depth-sorted order. An implementation should define blend equations and blend functions that result in properly blended RGB and alpha values, such as in the following example: +Materials shaded with this extension use the properties from the [PBR metallic roughness material](../../../specification/2.0#material) and [PBR specular glossiness extension](../KHR_materials_pbrSpecularGlossiness) to define the colors and textures needed for shading. This set of parameters will be referred to as `ambient`, `diffuse`, `emission`, `specular`, and `shininess` to match the literature on the subject. This extension defines which parameters are needed by which lighting models and how they should be computed from the material properties. -``` - functions: { - blendEquationSeparate: [ - WebGLConstants.FUNC_ADD, - WebGLConstants.FUNC_ADD - ], - blendFuncSeparate: [ - WebGLConstants.ONE, - WebGLConstants.ONE_MINUS_SRC_ALPHA, - WebGLConstants.ONE, - WebGLConstants.ONE_MINUS_SRC_ALPHA - ] - } -``` +#### Ambient + +__Applies To:__ `ALL` + +The ambient light reflected from the surface of the object. + +`material.occlusionTexture` is used as the ambient texture if it is defined. If undefined, it has a value of `[0.0, 0.0, 0.0, 1.0]`. + +#### Diffuse + +__Applies To:__ `BLINN`, `PHONG`, `LAMBERT` + +The light diffusely reflected from the surface of the object. + +`diffuse` is computed by multiplying `pbrMetallicRoughness.baseColorFactor` and `pbrMetallicRoughness.baseColorTexture`. If the `KHR_materials_pbrSpecularGlossiness` extension is defined, the `diffuseFactor` and `diffuseTexture` properties are also multiplied into `diffuse`. + +#### Emission +__Applies To:__ `ALL` + +The light emitted by the surface of the object. + +`emission` is computed by multiplying `emissiveFactor` and `emissiveTexture`. + +#### Specular + +__Applies To:__ `BLINN`, `PHONG` + +The light specularly reflected from the surface of the object. + +`specular` requires the `KHR_materials_pbrSpecularGlossiness` extension to be defined. It is computed by multiplying the `specularFactor` and `specularGlossinessTexture` properties. If the extension is undefined, it has a value of `[0.0, 0.0, 0.0, 1.0]`. + +#### Shininess + +__Applies To:__ `BLINN`, `PHONG` + +`shininess` is the ratio of `pbrMetallicRoughness.metallicFactor` and `pbrMetallicRoughness.roughnessFactor`. If `roughnessFactor` is `0`, the base shininess is just `metallicFactor`. If the `KHR_materials_pbrSpecularGlossiness` extension is defined, the `glossinessFactor` should be multiplied into `shininess`. + +### Lighting Model Shading + +This section describes the shading for each lighting model and references the relevant literature. The `ambient`, `diffuse`, `emission`, `specular`, and `shininess` parameters referred to in this section are as described in [material parameters](#material-parameters). References to lights in this section refer to any lights in the scene as defined by the renderer or explicitly defined in the glTF using the [KHR_lights](../KHR_lights) extension. #### Blinn -When the value of `technique` is `BLINN`, this defines a material shaded according to the Blinn-Torrance-Sparrow lighting model or a close approximation. +The material is shaded according to the Blinn-Torrance-Sparrow lighting model or a close approximation. This equation is complex and detailed via the ACM, so it is not detailed here. Refer to “Models of Light Reflection for Computer Synthesized Pictures,” SIGGRAPH 77, pp 192-198 [http://portal.acm.org/citation.cfm?id=563893](http://portal.acm.org/citation.cfm?id=563893). @@ -103,7 +111,7 @@ Reflection for Computer Synthesized Pictures,” SIGGRAPH 77, pp 192-198 [http:/ The following code illustrates the basic computation: ``` -color = + * al + * max(N * L, 0) + * max(H * N, 0)^ +color = + * al + * max(N * L, 0) + * max(H * N, 0)^ ``` where @@ -115,38 +123,14 @@ where * `H` – Half-angle vector,calculated as halfway between the unit Eye and Light vectors, using the equation H= normalize(I+L) -> **Implementation Note**: Writers should be aware about the range of the specular exponent (`shininess`), which is _not_ a normalized range. Concretely speaking, given the above equation, a `shininess` value of 1 corresponds to a very low shininess. For orientation: using the traditional OpenGL fixed function pipeline, the specular exponent was expected to be within [0, 128]. However, using glTF, larger `shininess` values are clearly possible. - -Blinn shading uses all of the common material properties defined in Table 1. The following example defines a Blinn shaded material with a diffuse texture, moderate shininess and red specular highlights. - -```javascript -"materials": { - "blinn1": { - "extensions": { - "KHR_materials_common" : { - "technique" : "BLINN", - "values": { - "diffuse": "texture_1", - "shininess": 10, - "specular": [ - 1, - 0, - 0, - 1 - ] - } - } - } - } -} -``` +> **Implementation Note**: Writers should be aware that the range of the specular exponent (`shininess`), is a normalized range. Concretely speaking, given the above equation, a `shininess` value of 1 corresponds to a very low shininess. For orientation: using the traditional OpenGL fixed function pipeline, the specular exponent was expected to be within [0, 128], hence the multiplication. #### Phong When the value of `technique` is `PHONG`, this defines a material with Phong shading. Phong shading produces a specularly shaded surface that reflects ambient, diffuse, and specular reflection, where the specular reflection is shaded according the Phong BRDF approximation: ``` -color = + * al + * max(N * L, 0) + * max(R * I, 0)^ +color = + * al + * max(N * L, 0) + * max(R * I, 0)^ ``` where: @@ -159,28 +143,6 @@ where: > **Implementation Note**: For the interpretation of the specular exponent parameter (`shininess`), see the section about the [Blinn](#blinn) lighting model. -Phong lighting uses all of the common material properties defined in Table 1. The following example defines a Phong lit material with a yellow diffuse color. - -```javascript -"materials": { - "blinn1": { - "extensions": { - "KHR_materials_common" : { - "technique" : "PHONG", - "values": { - "diffuse": [ - 1, - 1, - 0, - 1 - ] - } - } - } - } -} -``` - #### Lambert When the value of `technique` is `LAMBERT`, this defines a material shaded using Lambert shading. The result is based on Lambert’s Law, which states that when light hits a rough surface, the light is @@ -196,30 +158,7 @@ where * `N` – Normal vector * `L` – Light vector -Lambert shading does not reflect specular highlights; therefore the common material properties `specular` and `shininess` are not used. All other properties from Table 1 apply. - -The following example defines a Lambert shaded material with a 50% gray emissive color and a diffuse texture map. - -```javascript -"materials": { - "blinn1": { - "extensions": { - "KHR_materials_common" : { - "technique" : "LAMBERT", - "values": { - "diffuse": "texture_1", - "emission": [ - 0.5, - 0.5, - 0.5, - 1 - ] - } - } - } - } -} -``` +Lambert shading does not reflect specular highlights; therefore the common material properties `specular` and `shininess` are not used. #### Constant @@ -236,171 +175,35 @@ where * `al` – A constant amount of ambient light contribution coming from the scene, i.e. the sum of all ambient light values. -Constant shading does not reflect light sources in the scene; therefore the common material properties `diffuse`, `specular` and `shininess` are not used. All other properties from Table 1 apply. - -The following example defines a Constant lit material with an emissive texture and 50% opacity. - -```javascript -"materials": { - "blinn1": { - "extensions": { - "KHR_materials_common" : { - "technique" : "CONSTANT", - "values": { - "emission": "texture_2", - "transparency": 0.5 - } - } - } - } -} -``` - -### Interaction Between Attribute Semantics and Common Materials - -The base specification defines attribute semantics for mesh primitives. The common materials in this extension shall support the semantics `POSITION`, `NORMAL`, `TEXCOORD`, `COLOR`, `JOINT`, `JOINTMATRIX`, and `WEIGHT`. For array semantics such as texture coordinates, the implemention is only required to support the 0th set of coordinates i.e. `TEXCOORD_0`. -Since semantics are usually defined via technique parameters, they are not present in the glTF scene description when `KHR_materials_common` is used. -Therefore, writers using this extension must ensure that the attributes of the mesh are named exactly like the semantics: - -```javascript -"meshes": { - "mesh0":{ - "primitives" : [ - { - "attributes":{ - "NORMAL" :"accessor23", - "POSITION":"accessor42" - }, - "indices" : "accessor13", - "material": "material7", - "mode":4 - } - ] - } -} -``` - -If a conforming implementation of this extension supports skinned animations, then the common materials described in this extension must also support hardware skinning in its vertex and fragment shader programs. - - - -## Lights - -Lights define light sources in the scene. - -Lights are contained in nodes and thus can be transformed. Their world-space positions can be used in shader calculations. - -A conforming implementation of this extension must be able to load light data defined in the asset, but it is not obligated to render the asset using those lights. - -### Defining Lights - -Lights are defined within a dictionary property in the file, by adding an `extensions` property to the top-level glTF object and defining its `KHR_materials_common` property with a `lights` dictionary object inside it. - -Each light defines a `type` property that designates the type of light (`ambient`, `directional`, `point` or `spot`); a property of that same name defines the details, such as color, attenuation and other light type-specific values. The following example defines a white-colored directional light. - - -```javascript -"extensions": { - "KHR_materials_common" : { - "lights": { - "light1": { - "directional": { - "color": [ - 1, - 1, - 1 - ] - }, - "type": "directional" - } - } - } -} -``` - -IDs of any property within the `lights` extension property are treated like other glTF IDs, i.e. they are added to the global ID space. - - -### Adding Light Instances to Nodes - -Lights are glTF scene objects: they have position and orientation, which can be animated. Lights are placed in the scene by defining an `extensions` property of a node, and within that a `KHR_materials_common` property that identifies a light using its `light` property. - -```javascript -"nodes": { - "node1" : { - "children" : [ - ], - "extensions": { - "KHR_materials_common" : { - "light" : "light1", - } - } -} -``` - -For light types that have a direction (directional and spot lights), the light's direction is defined as the vector (0, 0, -1) and the rotation of the node orients the light accordingly. - - -### Light Types - -#### Common Light Shared Properties - -Table 2 lists properties that are shared among several of the common light types. - -Table 2. Common Light Shared Properties - -| Property | Type | Description | Default Value | Applies To | -|:----------------------------:|:------------:|:-----------:|:-------------:|:----------:| -| `color` | `FLOAT_VEC4` | RGBA value for light's color.|[0,0,0,1] | `ambient`, `directional`, `point`, `spot` | -| `constantAttenuation` | `FLOAT` | Constant attenuation of point and spot lights. | 0 | `point`, `spot` | -`directional`, `spot` | -| `distance` | `FLOAT` | Distance, in world units, over which the light affects objects in the scene. A value of zero indicates infinite distance. | 0 | `point`, `spot` | -| `linearAttenuation` | `FLOAT` | Linear (distance-based) attenuation of point and spot lights. | 1 | `point`, `spot` | -| `quadraticAttenuation` | `FLOAT` | Quadratic attenuation of point and spot lights. | 1 | `point`, `spot` | -| `type` | string | Declares the type of the light. Must be one of `ambient`, `directional`, `point` or `spot` | "" | `ambient`, `directional`, `point`, `spot` | - -### Ambient - -Ambient lights define constant lighting throughout the scene, as reflected in the `ambient` property of any material. Ambient lights support only the `color` common light property described in Table 2. - -#### Directional - -Directional lights are light sources that emit from infinitely far away in a specified direction. This light type uses the common light properties `color` and `direction` described in Table 2. - -### Point - -Point lights emit light in all directions over a given distance. Point lights support the `color`, `constantAttenuation`, `distance` and `linearAttenuation` common light properties described in Table 2. Point lights do not have a direction. - - -### Spot - -Sport lights emit light in a directions over a given distance. Spot lights support the `color`, `constantAttenuation`, `direction`, `distance` and `linearAttenuation` common light properties described in Table 2. Spot lights also define the following properties: +Constant shading does not reflect light sources in the scene; therefore the common material properties `diffuse`, `specular` and `shininess` are not used. -Table 3. Spot Light Properties +### Properties Reference -| Property | Type | Description | Default Value | -|:----------------------------:|:------------:|:-----------:|:-------------:| -| `falloffAngle` | `FLOAT` | Falloff angle for the spot light, in radians.| PI / 2 | -| `falloffExponent` | `FLOAT` | Falloff exponent for the spotlight. | 0 | +* [`KHR_materials_common glTF extension`](#reference-khr_materials_common-gltf-extension) (root object) - -## JSON Schema +--------------------------------------- + +## KHR_materials_common glTF extension -*To-do: Patrick need schema for each of the material types... can you help?* +glTF extension to use common lighting models for shading. - * `light` - * `light/ambient` - * `light/directional` - * `light/point` - * `light/spot` +**Properties** +| |Type|Description|Required| +|---|----|-----------|--------| +|**technique**|`integer`|Enum value defining which lighting model to use for the material.| :white_check_mark: Yes| - -## Conformance +Additional properties are allowed. -If this extension is supported, it will be used to apply shading to any visuals defined with common material types. +### KHR_materials_common glTF extension.technique :white_check_mark: -If a material contains this extension as well as a technique instance, the runtime can use its own shader implementation in favor of the supplied technique. +Enum value defining which lighting model to use for the material. -If the extension is not supported, and no technique is supplied in the material, then default shading will be applied per the rules defined in the base specification. +* **Type**: `integer` +* **Required**: Yes +* **Allowed values**: + * `0` BLINN + * `1` PHONG + * `2` LAMBERT + * `3` CONSTANT diff --git a/extensions/Khronos/KHR_materials_common/schema/examples/lights.json b/extensions/Khronos/KHR_materials_common/schema/examples/lights.json deleted file mode 100644 index 459354b938..0000000000 --- a/extensions/Khronos/KHR_materials_common/schema/examples/lights.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "extensions": { - "KHR_materials_common" : { - "lights" : { - "ambient_light_id": { - "ambient": { - "color": [ - 1.0, - 1.0, - 1.0 - ], - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } - }, - "name": "user-defined name of ambient light", - "type": "ambient", - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } - }, - "directional_light_id": { - "directional": { - "color": [ - 1.0, - 1.0, - 1.0 - ], - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } - }, - "name": "user-defined name of directional light", - "type": "directional", - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } - }, - "point_light_id": { - "name": "user-defined name of point light", - "point": { - "color": [ - 1.0, - 1.0, - 1.0 - ], - "constantAttenuation": 1.0, - "linearAttenuation": 0.5, - "quadraticAttenuation": 0.25, - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } - }, - "type": "point", - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } - }, - "spot_light_id": { - "name": "user-defined name of spot light", - "spot": { - "color": [ - 1.0, - 1.0, - 1.0 - ], - "constantAttenuation": 1.0, - "fallOffAngle": 40, - "fallOffExponent": 0.0, - "linearAttenuation": 0.5, - "quadraticAttenuation": 0.25, - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } - }, - "type": "spot", - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } - } - } - } - }, - "nodes" : { - "light_node_id": { - "children": [], - "matrix": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ], - "name": "user-defined name of light node", - "extensions": { - "KHR_materials_common" : { - "light": "point_light_id" - } - } - } - }, - "techniques" : { - "technique_id" : { - "name": "user-defined technique name", - "parameters": { - "lightTransform": { - "node": "directional_light_node_id", - "type": 35676 - }, - "modelViewMatrix": { - "semantic": "MODELVIEW", - "type": 35676 - }, - - "position": { - "semantic": "POSITION", - "type": 35665 - }, - }, - "attributes": { - "a_position": "position" - }, - "program": "program_id", - "uniforms": { - "u_lightTransformMatrix": "lightTransform" - }, - } - } -} \ No newline at end of file diff --git a/extensions/Khronos/KHR_materials_common/schema/glTF.KHR_materials_common.schema.json b/extensions/Khronos/KHR_materials_common/schema/glTF.KHR_materials_common.schema.json index 0cf41e6bdc..b72ab8587a 100644 --- a/extensions/Khronos/KHR_materials_common/schema/glTF.KHR_materials_common.schema.json +++ b/extensions/Khronos/KHR_materials_common/schema/glTF.KHR_materials_common.schema.json @@ -1,16 +1,33 @@ { - "$schema" : "http://json-schema.org/draft-04/schema", - "title" : "KHR_materials_common glTF extension", - "type" : "object", - "properties" : { - "lights" : { - "properties" : { - }, - "additionalProperties" : { - "$ref" : "light.schema.json" - }, - "default" : {} + "$schema": "http://json-schema.org/draft-04/schema", + "title": "KHR_materials_common glTF extension", + "description": "glTF extension to use common lighting models for shading.", + "type": "object", + "properties": { + "technique": { + "anyOf": [ + { + "enum": [ 0 ], + "description": "BLINN" + }, + { + "enum": [ 1 ], + "description": "PHONG" + }, + { + "enum": [ 2 ], + "description": "LAMBERT" + }, + { + "enum": [ 3 ], + "description": "CONSTANT" + }, + { + "type": "integer" + } + ], + "description": "Enum value defining which lighting model to use for the material." } }, - "additionalProperties" : false + "required": ["technique"] } diff --git a/extensions/Khronos/KHR_materials_common/schema/light.ambient.schema.json b/extensions/Khronos/KHR_materials_common/schema/light.ambient.schema.json deleted file mode 100644 index dfad551122..0000000000 --- a/extensions/Khronos/KHR_materials_common/schema/light.ambient.schema.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-04/schema", - "title" : "light/ambient", - "type" : "object", - "allOf" : [ { "$ref" : "glTFProperty.schema.json" } ], - "properties" : { - "color" : { - "type" : "array", - "description" : "RGB color of the light source.", - "items" : { - "type": "number", - "minimum" : 0.0, - "maximum" : 1.0 - }, - "minItems" : 3, - "maxItems" : 3, - "default" : [1.0, 1.0, 1.0], - "gltf_detailedDescription" : "RGB color of the light source. Each element is floating-point between 0.0 and 1.0. Element 0 corresponds to R, 1 to G, and 2 to B." - } - }, - "additionalProperties" : false -} diff --git a/extensions/Khronos/KHR_materials_common/schema/light.directional.schema.json b/extensions/Khronos/KHR_materials_common/schema/light.directional.schema.json deleted file mode 100644 index 3531ac61be..0000000000 --- a/extensions/Khronos/KHR_materials_common/schema/light.directional.schema.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-04/schema", - "title" : "light/directional", - "type" : "object", - "allOf" : [ { "$ref" : "glTFProperty.schema.json" } ], - "properties" : { - "color" : { - "type" : "array", - "description" : "RGB color of the light source.", - "items" : { - "type": "number", - "minimum" : 0.0, - "maximum" : 1.0 - }, - "minItems" : 3, - "maxItems" : 3, - "default" : [1.0, 1.0, 1.0], - "gltf_detailedDescription" : "RGB color of the light source. Each element is floating-point between 0.0 and 1.0. Element 0 corresponds to R, 1 to G, and 2 to B." - } - }, - "additionalProperties" : false -} diff --git a/extensions/Khronos/KHR_materials_common/schema/light.point.schema.json b/extensions/Khronos/KHR_materials_common/schema/light.point.schema.json deleted file mode 100644 index a7daf74022..0000000000 --- a/extensions/Khronos/KHR_materials_common/schema/light.point.schema.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-04/schema", - "title" : "light/point", - "type" : "object", - "allOf" : [ { "$ref" : "glTFProperty.schema.json" } ], - "properties" : { - "color" : { - "type" : "array", - "description" : "RGB color of the light source.", - "items" : { - "type": "number", - "minimum" : 0.0, - "maximum" : 1.0 - }, - "minItems" : 3, - "maxItems" : 3, - "default" : [1.0, 1.0, 1.0], - "gltf_detailedDescription" : "RGB color of the light source. Each element is floating-point between 0.0 and 1.0. Element 0 corresponds to R, 1 to G, and 2 to B." - }, - "constantAttenuation" : { - "type" : "number", - "description" : "Constant attenuation factor.", - "default" : 1.0 - }, - "linearAttenuation" : { - "type" : "number", - "description" : "Linear attenuation factor.", - "default" : 0.0 - }, - "quadraticAttenuation" : { - "type" : "number", - "description" : "Quadratic attenuation factor.", - "default" : 0.0 - } - }, - "additionalProperties" : false -} diff --git a/extensions/Khronos/KHR_materials_common/schema/light.schema.json b/extensions/Khronos/KHR_materials_common/schema/light.schema.json deleted file mode 100644 index ce8f508fdc..0000000000 --- a/extensions/Khronos/KHR_materials_common/schema/light.schema.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-04/schema", - "title" : "light", - "type" : "object", - "description" : "An ambient, directional, point, or spot light.", - "allOf" : [ { "$ref" : "glTFChildOfRootProperty.schema.json" } ], - "properties" : { - "ambient" : { - "allOf" : [ { "$ref" : "light.ambient.schema.json" } ], - "description" : "Ambient light source." - }, - "directional" : { - "allOf" : [ { "$ref" : "light.directional.schema.json" } ], - "description" : "Directional light source." - }, - "point" : { - "allOf" : [ { "$ref" : "light.point.schema.json" } ], - "description" : "Point light source." - }, - "spot" : { - "allOf" : [ { "$ref" : "light.spot.schema.json" } ], - "description" : "Spot light source." - }, - "type" : { - "type" : "string", - "description" : "Specifies the light type.", - "enum" : ["ambient", "directional", "point", "spot"] - } - }, - "additionalProperties" : false, - "required" : ["type"] -} diff --git a/extensions/Khronos/KHR_materials_common/schema/light.spot.schema.json b/extensions/Khronos/KHR_materials_common/schema/light.spot.schema.json deleted file mode 100644 index 8980704a12..0000000000 --- a/extensions/Khronos/KHR_materials_common/schema/light.spot.schema.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-04/schema", - "title" : "light/spot", - "type" : "object", - "allOf" : [ { "$ref" : "glTFProperty.schema.json" } ], - "properties" : { - "color" : { - "type" : "array", - "description" : "RGB color of the light source.", - "items" : { - "type": "number", - "minimum" : 0.0, - "maximum" : 1.0 - }, - "minItems" : 3, - "maxItems" : 3, - "default" : [1.0, 1.0, 1.0], - "gltf_detailedDescription" : "RGB color of the light source. Each element is floating-point between 0.0 and 1.0. Element 0 corresponds to R, 1 to G, and 2 to B." - }, - "constantAttenuation" : { - "type" : "number", - "description" : "Constant attenuation factor.", - "default" : 1.0 - }, - "fallOffAngle" : { - "type" : "number", - "description" : "Fall off angle in radians.", - "default" : 3.14159265 - }, - "fallOffExponent" : { - "type" : "number", - "description" : "Fall off exponent.", - "default" : 0.0 - }, - "linearAttenuation" : { - "type" : "number", - "description" : "Linear attenuation factor.", - "default" : 0.0 - }, - "quadraticAttenuation" : { - "type" : "number", - "description" : "Quadratic attenuation factor.", - "default" : 0.0 - } - }, - "additionalProperties" : false -} diff --git a/extensions/Khronos/KHR_materials_common/schema/node.KHR_materials_common.schema.json b/extensions/Khronos/KHR_materials_common/schema/node.KHR_materials_common.schema.json deleted file mode 100644 index 9623129103..0000000000 --- a/extensions/Khronos/KHR_materials_common/schema/node.KHR_materials_common.schema.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-04/schema", - "title" : "KHR_materials_common node extension", - "type" : "object", - "properties" : { - "light" : { - "allOf" : [ { "$ref" : "glTFid.schema.json" } ], - "description" : "The id of the light referenced by this node." - } - }, - "additionalProperties" : false -}