From e6163017de6ea009843c0a6adc700685a4a1cf28 Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Thu, 19 Sep 2019 17:21:52 -0400 Subject: [PATCH 1/4] Add KHR_materials_clearcoat to schema importer system. --- README.md | 1 + util/extensionMap2.0.json | 1 + util/importAll.sh | 2 ++ 3 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 2a94047..19feda6 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,7 @@ Certain glTF 2.0 extensions are supported by JSON schema validation in VSCode. * `KHR_draco_mesh_compression` * `KHR_lights_punctual` +* `KHR_materials_clearcoat` * `KHR_materials_pbrSpecularGlossiness` * `KHR_materials_unlit` * `KHR_techniques_webgl` (Draft) diff --git a/util/extensionMap2.0.json b/util/extensionMap2.0.json index 5c2e537..f59c5e0 100644 --- a/util/extensionMap2.0.json +++ b/util/extensionMap2.0.json @@ -12,6 +12,7 @@ "material": { "title": "Material Extensions", "extensions": { + "KHR_materials_clearcoat": "glTF.KHR_materials_clearcoat.schema.json", "KHR_materials_pbrSpecularGlossiness": "glTF.KHR_materials_pbrSpecularGlossiness.schema.json", "KHR_materials_unlit": "glTF.KHR_materials_unlit.schema.json" } diff --git a/util/importAll.sh b/util/importAll.sh index 1926c77..1058474 100644 --- a/util/importAll.sh +++ b/util/importAll.sh @@ -9,6 +9,8 @@ echo "~~~ KHR_draco_mesh_compression ~~~" ./importSchema.js -i ../../glTF/extensions/2.0/Khronos/KHR_draco_mesh_compression/schema -o ../schemas/gltf-2.0/extensions/KHR_draco_mesh_compression -s ../../ echo "~~~ KHR_lights_punctual ~~~" ./importSchema.js -i ../../glTF/extensions/2.0/Khronos/KHR_lights_punctual/schema -o ../schemas/gltf-2.0/extensions/KHR_lights_punctual -s ../../ +echo "~~~ KHR_materials_clearcoat ~~~" +./importSchema.js -i ../../glTF/extensions/2.0/Khronos/KHR_materials_clearcoat/schema -o ../schemas/gltf-2.0/extensions/KHR_materials_clearcoat -s ../../ echo "~~~ KHR_materials_pbrSpecularGlossiness ~~~" ./importSchema.js -i ../../glTF/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/schema -o ../schemas/gltf-2.0/extensions/KHR_materials_pbrSpecularGlossiness -s ../../ echo "~~~ KHR_materials_unlit ~~~" From a0b2c5c83ed326d6d73e3eba641e1535583bd28e Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Thu, 19 Sep 2019 17:24:10 -0400 Subject: [PATCH 2/4] Re-run schema importer --- .../glTF.KHR_materials_clearcoat.schema.json | 58 +++++++++++++++++++ ...aterials_pbrSpecularGlossiness.schema.json | 4 +- .../material.pbrMetallicRoughness.schema.json | 2 +- schemas/gltf-2.0/material.schema.json | 9 ++- 4 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 schemas/gltf-2.0/extensions/KHR_materials_clearcoat/glTF.KHR_materials_clearcoat.schema.json diff --git a/schemas/gltf-2.0/extensions/KHR_materials_clearcoat/glTF.KHR_materials_clearcoat.schema.json b/schemas/gltf-2.0/extensions/KHR_materials_clearcoat/glTF.KHR_materials_clearcoat.schema.json new file mode 100644 index 0000000..3395d0b --- /dev/null +++ b/schemas/gltf-2.0/extensions/KHR_materials_clearcoat/glTF.KHR_materials_clearcoat.schema.json @@ -0,0 +1,58 @@ +{ + "$schema" : "http://json-schema.org/draft-04/schema", + "title" : "KHR_materials_clearcoat glTF extension", + "type" : "object", + "description" : "glTF extension that defines the clearcoat material layer.", + "allOf" : [ + { + "$ref" : "../../glTFProperty.schema.json" + } + ], + "properties" : { + "clearcoatFactor" : { + "type" : "number", + "description" : "The clearcoat layer intensity (aka opacity) of the material. A value of 0.0 means the material has no clearcoat layer enabled.", + "default" : 0, + "minimum" : 0, + "maximum" : 1, + "short_description" : "The clearcoat layer intensity." + }, + "clearcoatTexture" : { + "allOf" : [ + { + "$ref" : "../../textureInfo.schema.json" + } + ], + "description" : "The clearcoat layer intensity texture. Stored in channel R with default linear value 1.0.", + "short_description" : "The clearcoat layer intensity texture." + }, + "clearcoatRoughnessFactor" : { + "type" : "number", + "description" : "The clearcoat layer roughness of the material.", + "default" : 0, + "minimum" : 0, + "maximum" : 1, + "short_description" : "The clearcoat layer roughness." + }, + "clearcoatRoughnessTexture" : { + "allOf" : [ + { + "$ref" : "../../textureInfo.schema.json" + } + ], + "description" : "The clearcoat layer roughness texture. Stored in channel G with default linear value 1.0.", + "short_description" : "The clearcoat layer roughness texture." + }, + "clearcoatNormalTexture" : { + "allOf" : [ + { + "$ref" : "../../material.normalTextureInfo.schema.json" + } + ], + "description" : "A tangent space normal map for the clearcoat layer.", + "short_description" : "The clearcoat normal map texture." + }, + "extensions" : {}, + "extras" : {} + } +} diff --git a/schemas/gltf-2.0/extensions/KHR_materials_pbrSpecularGlossiness/glTF.KHR_materials_pbrSpecularGlossiness.schema.json b/schemas/gltf-2.0/extensions/KHR_materials_pbrSpecularGlossiness/glTF.KHR_materials_pbrSpecularGlossiness.schema.json index cb527c9..d63cfad 100644 --- a/schemas/gltf-2.0/extensions/KHR_materials_pbrSpecularGlossiness/glTF.KHR_materials_pbrSpecularGlossiness.schema.json +++ b/schemas/gltf-2.0/extensions/KHR_materials_pbrSpecularGlossiness/glTF.KHR_materials_pbrSpecularGlossiness.schema.json @@ -33,7 +33,7 @@ "$ref" : "../../textureInfo.schema.json" } ], - "description" : "The diffuse texture. This texture contains RGB(A) components of the reflected diffuse color of the material in sRGB color space. If the fourth component (A) is present, it represents the alpha coverage of the material. Otherwise, an alpha of 1.0 is assumed. The `alphaMode` property specifies how alpha is interpreted. The stored texels must not be premultiplied.", + "description" : "The diffuse texture. This texture contains RGB components of the reflected diffuse color of the material encoded with the sRGB transfer function. If the fourth component (A) is present, it represents the linear alpha coverage of the material. Otherwise, an alpha of 1.0 is assumed. The `alphaMode` property specifies how alpha is interpreted. The stored texels must not be premultiplied.", "short_description" : "The diffuse texture." }, "specularFactor" : { @@ -67,7 +67,7 @@ "$ref" : "../../textureInfo.schema.json" } ], - "description" : "The specular-glossiness texture is RGBA texture, containing the specular color of the material (RGB components) and its glossiness (A component). The values are in sRGB space.", + "description" : "The specular-glossiness texture is an RGBA texture, containing the specular color (RGB) encoded with the sRGB transfer function and the linear glossiness value (A).", "short_description" : "The specular-glossiness texture." }, "extensions" : {}, diff --git a/schemas/gltf-2.0/material.pbrMetallicRoughness.schema.json b/schemas/gltf-2.0/material.pbrMetallicRoughness.schema.json index 6202b01..a0c6b09 100644 --- a/schemas/gltf-2.0/material.pbrMetallicRoughness.schema.json +++ b/schemas/gltf-2.0/material.pbrMetallicRoughness.schema.json @@ -33,7 +33,7 @@ "$ref" : "textureInfo.schema.json" } ], - "description" : "The base color texture. This texture contains RGB(A) components in sRGB color space. The first three components (RGB) specify the base color of the material. If the fourth component (A) is present, it represents the alpha coverage of the material. Otherwise, an alpha of 1.0 is assumed. The `alphaMode` property specifies how alpha is interpreted. The stored texels must not be premultiplied.", + "description" : "The base color texture. The first three components (RGB) are encoded with the sRGB transfer function. They specify the base color of the material. If the fourth component (A) is present, it represents the linear alpha coverage of the material. Otherwise, an alpha of 1.0 is assumed. The `alphaMode` property specifies how alpha is interpreted. The stored texels must not be premultiplied.", "short_description" : "The base color texture." }, "metallicFactor" : { diff --git a/schemas/gltf-2.0/material.schema.json b/schemas/gltf-2.0/material.schema.json index 342ceb3..35ec6a7 100644 --- a/schemas/gltf-2.0/material.schema.json +++ b/schemas/gltf-2.0/material.schema.json @@ -12,6 +12,13 @@ "name" : {}, "extensions" : { "properties" : { + "KHR_materials_clearcoat" : { + "allOf" : [ + { + "$ref" : "extensions/KHR_materials_clearcoat/glTF.KHR_materials_clearcoat.schema.json" + } + ] + }, "KHR_materials_pbrSpecularGlossiness" : { "allOf" : [ { @@ -61,7 +68,7 @@ "$ref" : "textureInfo.schema.json" } ], - "description" : "The emissive map controls the color and intensity of the light being emitted by the material. This texture contains RGB components in sRGB color space. If a fourth component (A) is present, it is ignored.", + "description" : "The emissive map controls the color and intensity of the light being emitted by the material. This texture contains RGB components encoded with the sRGB transfer function. If a fourth component (A) is present, it is ignored.", "short_description" : "The emissive map texture." }, "emissiveFactor" : { From d21ae7a86213e57641d91158502bd3d32aeaa21a Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Thu, 27 Feb 2020 11:11:26 -0500 Subject: [PATCH 3/4] Re-import clearcoat schema with latest changes. --- .../glTF.KHR_materials_clearcoat.schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schemas/gltf-2.0/extensions/KHR_materials_clearcoat/glTF.KHR_materials_clearcoat.schema.json b/schemas/gltf-2.0/extensions/KHR_materials_clearcoat/glTF.KHR_materials_clearcoat.schema.json index 3395d0b..710414c 100644 --- a/schemas/gltf-2.0/extensions/KHR_materials_clearcoat/glTF.KHR_materials_clearcoat.schema.json +++ b/schemas/gltf-2.0/extensions/KHR_materials_clearcoat/glTF.KHR_materials_clearcoat.schema.json @@ -23,7 +23,7 @@ "$ref" : "../../textureInfo.schema.json" } ], - "description" : "The clearcoat layer intensity texture. Stored in channel R with default linear value 1.0.", + "description" : "The clearcoat layer intensity texture. These values are sampled from the R channel. The values are linear. Use value 1.0 if no texture is supplied.", "short_description" : "The clearcoat layer intensity texture." }, "clearcoatRoughnessFactor" : { @@ -40,7 +40,7 @@ "$ref" : "../../textureInfo.schema.json" } ], - "description" : "The clearcoat layer roughness texture. Stored in channel G with default linear value 1.0.", + "description" : "The clearcoat layer roughness texture. These values are sampled from the G channel. The values are linear. Use value 1.0 if no texture is supplied.", "short_description" : "The clearcoat layer roughness texture." }, "clearcoatNormalTexture" : { @@ -49,7 +49,7 @@ "$ref" : "../../material.normalTextureInfo.schema.json" } ], - "description" : "A tangent space normal map for the clearcoat layer.", + "description" : "A tangent space normal map for the clearcoat layer. If desired, this may be a reference to the same normal map used by the base material. If not supplied, no normal mapping is applied to the clear coat layer.", "short_description" : "The clearcoat normal map texture." }, "extensions" : {}, From 0ffc4db6d9b7dc3ed2512132c67a70fb2650fadc Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Thu, 27 Feb 2020 11:21:08 -0500 Subject: [PATCH 4/4] CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7031bc5..b9adcf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +### 2.2.10 - UNRELEASED + +* Add `KHR_materials_clearcoat` extension schema. [#180](https://github.com/AnalyticalGraphicsInc/gltf-vscode/pull/180) + ### 2.2.9 - 2020-01-22 * Update Khronos glTF-Validator to 2.0.0-dev.3.2. [KhronosGroup/glTF-Validator#129](https://github.com/KhronosGroup/glTF-Validator/pull/129) and [KhronosGroup/glTF-Validator#131](https://github.com/KhronosGroup/glTF-Validator/pull/131)