From 26b2ad1567b1e51d4e3bb4cec0eff1387799ecf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20H=C3=A4rtl?= Date: Wed, 16 Mar 2022 15:45:10 +0100 Subject: [PATCH] Prepare release --- API.md | 385 +++++++++++++++++++++++++-------- package.json | 2 +- source/GltfState/gltf_state.js | 21 ++ 3 files changed, 320 insertions(+), 88 deletions(-) diff --git a/API.md b/API.md index 4ac6f615..a382d73a 100644 --- a/API.md +++ b/API.md @@ -133,23 +133,43 @@ GltfState containing a state for visualization in GltfView * [.ACES_HILL](#GltfState.ToneMaps.ACES_HILL) * [.DebugOutput](#GltfState.DebugOutput) * [.NONE](#GltfState.DebugOutput.NONE) - * [.METALLIC](#GltfState.DebugOutput.METALLIC) - * [.ROUGHNESS](#GltfState.DebugOutput.ROUGHNESS) - * [.NORMAL](#GltfState.DebugOutput.NORMAL) - * [.WORLDSPACENORMAL](#GltfState.DebugOutput.WORLDSPACENORMAL) - * [.GEOMETRYNORMAL](#GltfState.DebugOutput.GEOMETRYNORMAL) - * [.TANGENT](#GltfState.DebugOutput.TANGENT) - * [.BITANGENT](#GltfState.DebugOutput.BITANGENT) - * [.BASECOLOR](#GltfState.DebugOutput.BASECOLOR) - * [.OCCLUSION](#GltfState.DebugOutput.OCCLUSION) - * [.EMISSIVE](#GltfState.DebugOutput.EMISSIVE) - * [.DIFFUSE](#GltfState.DebugOutput.DIFFUSE) - * [.SPECULAR](#GltfState.DebugOutput.SPECULAR) - * [.CLEARCOAT](#GltfState.DebugOutput.CLEARCOAT) - * [.SHEEN](#GltfState.DebugOutput.SHEEN) - * [.TRANSMISSION](#GltfState.DebugOutput.TRANSMISSION) - * [.ALPHA](#GltfState.DebugOutput.ALPHA) - * [.F0](#GltfState.DebugOutput.F0) + * [.generic](#GltfState.DebugOutput.generic) + * [.UV_COORDS_0](#GltfState.DebugOutput.generic.UV_COORDS_0) + * [.UV_COORDS_1](#GltfState.DebugOutput.generic.UV_COORDS_1) + * [.NORMAL](#GltfState.DebugOutput.generic.NORMAL) + * [.GEOMETRYNORMAL](#GltfState.DebugOutput.generic.GEOMETRYNORMAL) + * [.TANGENT](#GltfState.DebugOutput.generic.TANGENT) + * [.BITANGENT](#GltfState.DebugOutput.generic.BITANGENT) + * [.WORLDSPACENORMAL](#GltfState.DebugOutput.generic.WORLDSPACENORMAL) + * [.ALPHA](#GltfState.DebugOutput.generic.ALPHA) + * [.OCCLUSION](#GltfState.DebugOutput.generic.OCCLUSION) + * [.EMISSIVE](#GltfState.DebugOutput.generic.EMISSIVE) + * [.mr](#GltfState.DebugOutput.mr) + * [.METALLIC_ROUGHNESS](#GltfState.DebugOutput.mr.METALLIC_ROUGHNESS) + * [.BASECOLOR](#GltfState.DebugOutput.mr.BASECOLOR) + * [.METALLIC](#GltfState.DebugOutput.mr.METALLIC) + * [.ROUGHNESS](#GltfState.DebugOutput.mr.ROUGHNESS) + * [.clearcoat](#GltfState.DebugOutput.clearcoat) + * [.CLEARCOAT](#GltfState.DebugOutput.clearcoat.CLEARCOAT) + * [.CLEARCOAT_FACTOR](#GltfState.DebugOutput.clearcoat.CLEARCOAT_FACTOR) + * [.CLEARCOAT_ROUGHNESS](#GltfState.DebugOutput.clearcoat.CLEARCOAT_ROUGHNESS) + * [.CLEARCOAT_NORMAL](#GltfState.DebugOutput.clearcoat.CLEARCOAT_NORMAL) + * [.sheen](#GltfState.DebugOutput.sheen) + * [.SHEEN](#GltfState.DebugOutput.sheen.SHEEN) + * [.SHEEN_COLOR](#GltfState.DebugOutput.sheen.SHEEN_COLOR) + * [.SHEEN_ROUGHNESS](#GltfState.DebugOutput.sheen.SHEEN_ROUGHNESS) + * [.specular](#GltfState.DebugOutput.specular) + * [.SPECULAR](#GltfState.DebugOutput.specular.SPECULAR) + * [.SPECULAR_FACTOR](#GltfState.DebugOutput.specular.SPECULAR_FACTOR) + * [.SPECULAR_COLOR](#GltfState.DebugOutput.specular.SPECULAR_COLOR) + * [.transmission](#GltfState.DebugOutput.transmission) + * [.TRANSMISSION_VOLUME](#GltfState.DebugOutput.transmission.TRANSMISSION_VOLUME) + * [.TRANSMISSION_FACTOR](#GltfState.DebugOutput.transmission.TRANSMISSION_FACTOR) + * [.VOLUME_THICKNESS](#GltfState.DebugOutput.transmission.VOLUME_THICKNESS) + * [.iridescence](#GltfState.DebugOutput.iridescence) + * [.IRIDESCENCE](#GltfState.DebugOutput.iridescence.IRIDESCENCE) + * [.IRIDESCENCE_FACTOR](#GltfState.DebugOutput.iridescence.IRIDESCENCE_FACTOR) + * [.IRIDESCENCE_THICKNESS](#GltfState.DebugOutput.iridescence.IRIDESCENCE_THICKNESS) @@ -364,23 +384,43 @@ such as "NORMAL" * [.DebugOutput](#GltfState.DebugOutput) * [.NONE](#GltfState.DebugOutput.NONE) - * [.METALLIC](#GltfState.DebugOutput.METALLIC) - * [.ROUGHNESS](#GltfState.DebugOutput.ROUGHNESS) - * [.NORMAL](#GltfState.DebugOutput.NORMAL) - * [.WORLDSPACENORMAL](#GltfState.DebugOutput.WORLDSPACENORMAL) - * [.GEOMETRYNORMAL](#GltfState.DebugOutput.GEOMETRYNORMAL) - * [.TANGENT](#GltfState.DebugOutput.TANGENT) - * [.BITANGENT](#GltfState.DebugOutput.BITANGENT) - * [.BASECOLOR](#GltfState.DebugOutput.BASECOLOR) - * [.OCCLUSION](#GltfState.DebugOutput.OCCLUSION) - * [.EMISSIVE](#GltfState.DebugOutput.EMISSIVE) - * [.DIFFUSE](#GltfState.DebugOutput.DIFFUSE) - * [.SPECULAR](#GltfState.DebugOutput.SPECULAR) - * [.CLEARCOAT](#GltfState.DebugOutput.CLEARCOAT) - * [.SHEEN](#GltfState.DebugOutput.SHEEN) - * [.TRANSMISSION](#GltfState.DebugOutput.TRANSMISSION) - * [.ALPHA](#GltfState.DebugOutput.ALPHA) - * [.F0](#GltfState.DebugOutput.F0) + * [.generic](#GltfState.DebugOutput.generic) + * [.UV_COORDS_0](#GltfState.DebugOutput.generic.UV_COORDS_0) + * [.UV_COORDS_1](#GltfState.DebugOutput.generic.UV_COORDS_1) + * [.NORMAL](#GltfState.DebugOutput.generic.NORMAL) + * [.GEOMETRYNORMAL](#GltfState.DebugOutput.generic.GEOMETRYNORMAL) + * [.TANGENT](#GltfState.DebugOutput.generic.TANGENT) + * [.BITANGENT](#GltfState.DebugOutput.generic.BITANGENT) + * [.WORLDSPACENORMAL](#GltfState.DebugOutput.generic.WORLDSPACENORMAL) + * [.ALPHA](#GltfState.DebugOutput.generic.ALPHA) + * [.OCCLUSION](#GltfState.DebugOutput.generic.OCCLUSION) + * [.EMISSIVE](#GltfState.DebugOutput.generic.EMISSIVE) + * [.mr](#GltfState.DebugOutput.mr) + * [.METALLIC_ROUGHNESS](#GltfState.DebugOutput.mr.METALLIC_ROUGHNESS) + * [.BASECOLOR](#GltfState.DebugOutput.mr.BASECOLOR) + * [.METALLIC](#GltfState.DebugOutput.mr.METALLIC) + * [.ROUGHNESS](#GltfState.DebugOutput.mr.ROUGHNESS) + * [.clearcoat](#GltfState.DebugOutput.clearcoat) + * [.CLEARCOAT](#GltfState.DebugOutput.clearcoat.CLEARCOAT) + * [.CLEARCOAT_FACTOR](#GltfState.DebugOutput.clearcoat.CLEARCOAT_FACTOR) + * [.CLEARCOAT_ROUGHNESS](#GltfState.DebugOutput.clearcoat.CLEARCOAT_ROUGHNESS) + * [.CLEARCOAT_NORMAL](#GltfState.DebugOutput.clearcoat.CLEARCOAT_NORMAL) + * [.sheen](#GltfState.DebugOutput.sheen) + * [.SHEEN](#GltfState.DebugOutput.sheen.SHEEN) + * [.SHEEN_COLOR](#GltfState.DebugOutput.sheen.SHEEN_COLOR) + * [.SHEEN_ROUGHNESS](#GltfState.DebugOutput.sheen.SHEEN_ROUGHNESS) + * [.specular](#GltfState.DebugOutput.specular) + * [.SPECULAR](#GltfState.DebugOutput.specular.SPECULAR) + * [.SPECULAR_FACTOR](#GltfState.DebugOutput.specular.SPECULAR_FACTOR) + * [.SPECULAR_COLOR](#GltfState.DebugOutput.specular.SPECULAR_COLOR) + * [.transmission](#GltfState.DebugOutput.transmission) + * [.TRANSMISSION_VOLUME](#GltfState.DebugOutput.transmission.TRANSMISSION_VOLUME) + * [.TRANSMISSION_FACTOR](#GltfState.DebugOutput.transmission.TRANSMISSION_FACTOR) + * [.VOLUME_THICKNESS](#GltfState.DebugOutput.transmission.VOLUME_THICKNESS) + * [.iridescence](#GltfState.DebugOutput.iridescence) + * [.IRIDESCENCE](#GltfState.DebugOutput.iridescence.IRIDESCENCE) + * [.IRIDESCENCE_FACTOR](#GltfState.DebugOutput.iridescence.IRIDESCENCE_FACTOR) + * [.IRIDESCENCE_THICKNESS](#GltfState.DebugOutput.iridescence.IRIDESCENCE_THICKNESS) @@ -388,108 +428,279 @@ such as "NORMAL" standard rendering - debug output is disabled **Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - + -#### DebugOutput.METALLIC -output the metallic value from pbr metallic roughness +#### DebugOutput.generic +generic debug outputs **Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - -#### DebugOutput.ROUGHNESS -output the roughness value from pbr metallic roughness +* [.generic](#GltfState.DebugOutput.generic) + * [.UV_COORDS_0](#GltfState.DebugOutput.generic.UV_COORDS_0) + * [.UV_COORDS_1](#GltfState.DebugOutput.generic.UV_COORDS_1) + * [.NORMAL](#GltfState.DebugOutput.generic.NORMAL) + * [.GEOMETRYNORMAL](#GltfState.DebugOutput.generic.GEOMETRYNORMAL) + * [.TANGENT](#GltfState.DebugOutput.generic.TANGENT) + * [.BITANGENT](#GltfState.DebugOutput.generic.BITANGENT) + * [.WORLDSPACENORMAL](#GltfState.DebugOutput.generic.WORLDSPACENORMAL) + * [.ALPHA](#GltfState.DebugOutput.generic.ALPHA) + * [.OCCLUSION](#GltfState.DebugOutput.generic.OCCLUSION) + * [.EMISSIVE](#GltfState.DebugOutput.generic.EMISSIVE) -**Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - + -#### DebugOutput.NORMAL -output the normal map value in TBN space +##### generic.UV\_COORDS\_0 +output the texture coordinates 0 -**Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - +**Kind**: static property of [generic](#GltfState.DebugOutput.generic) + + +##### generic.UV\_COORDS\_1 +output the texture coordinates 1 -#### DebugOutput.WORLDSPACENORMAL +**Kind**: static property of [generic](#GltfState.DebugOutput.generic) + + +##### generic.NORMAL output the world space normals (i.e. with TBN applied) -**Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - +**Kind**: static property of [generic](#GltfState.DebugOutput.generic) + -#### DebugOutput.GEOMETRYNORMAL +##### generic.GEOMETRYNORMAL output the normal from the TBN -**Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - +**Kind**: static property of [generic](#GltfState.DebugOutput.generic) + -#### DebugOutput.TANGENT +##### generic.TANGENT output the tangent from the TBN -**Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - +**Kind**: static property of [generic](#GltfState.DebugOutput.generic) + -#### DebugOutput.BITANGENT +##### generic.BITANGENT output the bitangent from the TBN -**Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - +**Kind**: static property of [generic](#GltfState.DebugOutput.generic) + -#### DebugOutput.BASECOLOR -output the base color value +##### generic.WORLDSPACENORMAL +output the world space normals (i.e. with TBN applied) -**Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - +**Kind**: static property of [generic](#GltfState.DebugOutput.generic) + + +##### generic.ALPHA +output the alpha value -#### DebugOutput.OCCLUSION +**Kind**: static property of [generic](#GltfState.DebugOutput.generic) + + +##### generic.OCCLUSION output the occlusion value -**Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - +**Kind**: static property of [generic](#GltfState.DebugOutput.generic) + -#### DebugOutput.EMISSIVE +##### generic.EMISSIVE output the emissive value -**Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - +**Kind**: static property of [generic](#GltfState.DebugOutput.generic) + -#### DebugOutput.DIFFUSE -output diffuse lighting +#### DebugOutput.mr +output metallic roughness **Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - -#### DebugOutput.SPECULAR -output specular lighting +* [.mr](#GltfState.DebugOutput.mr) + * [.METALLIC_ROUGHNESS](#GltfState.DebugOutput.mr.METALLIC_ROUGHNESS) + * [.BASECOLOR](#GltfState.DebugOutput.mr.BASECOLOR) + * [.METALLIC](#GltfState.DebugOutput.mr.METALLIC) + * [.ROUGHNESS](#GltfState.DebugOutput.mr.ROUGHNESS) -**Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - + -#### DebugOutput.CLEARCOAT +##### mr.METALLIC\_ROUGHNESS +output the combined metallic roughness + +**Kind**: static property of [mr](#GltfState.DebugOutput.mr) + + +##### mr.BASECOLOR +output the base color value + +**Kind**: static property of [mr](#GltfState.DebugOutput.mr) + + +##### mr.METALLIC +output the metallic value from pbr metallic roughness + +**Kind**: static property of [mr](#GltfState.DebugOutput.mr) + + +##### mr.ROUGHNESS +output the roughness value from pbr metallic roughness + +**Kind**: static property of [mr](#GltfState.DebugOutput.mr) + + +#### DebugOutput.clearcoat output clearcoat lighting **Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - -#### DebugOutput.SHEEN +* [.clearcoat](#GltfState.DebugOutput.clearcoat) + * [.CLEARCOAT](#GltfState.DebugOutput.clearcoat.CLEARCOAT) + * [.CLEARCOAT_FACTOR](#GltfState.DebugOutput.clearcoat.CLEARCOAT_FACTOR) + * [.CLEARCOAT_ROUGHNESS](#GltfState.DebugOutput.clearcoat.CLEARCOAT_ROUGHNESS) + * [.CLEARCOAT_NORMAL](#GltfState.DebugOutput.clearcoat.CLEARCOAT_NORMAL) + + + +##### clearcoat.CLEARCOAT +output the combined clear coat + +**Kind**: static property of [clearcoat](#GltfState.DebugOutput.clearcoat) + + +##### clearcoat.CLEARCOAT\_FACTOR +output the clear coat factor + +**Kind**: static property of [clearcoat](#GltfState.DebugOutput.clearcoat) + + +##### clearcoat.CLEARCOAT\_ROUGHNESS +output the clear coat roughness + +**Kind**: static property of [clearcoat](#GltfState.DebugOutput.clearcoat) + + +##### clearcoat.CLEARCOAT\_NORMAL +output the clear coat normal + +**Kind**: static property of [clearcoat](#GltfState.DebugOutput.clearcoat) + + +#### DebugOutput.sheen output sheen lighting **Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - -#### DebugOutput.TRANSMISSION -output tranmission lighting +* [.sheen](#GltfState.DebugOutput.sheen) + * [.SHEEN](#GltfState.DebugOutput.sheen.SHEEN) + * [.SHEEN_COLOR](#GltfState.DebugOutput.sheen.SHEEN_COLOR) + * [.SHEEN_ROUGHNESS](#GltfState.DebugOutput.sheen.SHEEN_ROUGHNESS) + + + +##### sheen.SHEEN +output the combined sheen + +**Kind**: static property of [sheen](#GltfState.DebugOutput.sheen) + + +##### sheen.SHEEN\_COLOR +output the sheen color + +**Kind**: static property of [sheen](#GltfState.DebugOutput.sheen) + + +##### sheen.SHEEN\_ROUGHNESS +output the sheen roughness + +**Kind**: static property of [sheen](#GltfState.DebugOutput.sheen) + + +#### DebugOutput.specular +output specular lighting **Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - -#### DebugOutput.ALPHA -output the alpha value +* [.specular](#GltfState.DebugOutput.specular) + * [.SPECULAR](#GltfState.DebugOutput.specular.SPECULAR) + * [.SPECULAR_FACTOR](#GltfState.DebugOutput.specular.SPECULAR_FACTOR) + * [.SPECULAR_COLOR](#GltfState.DebugOutput.specular.SPECULAR_COLOR) + + + +##### specular.SPECULAR +output the combined specular + +**Kind**: static property of [specular](#GltfState.DebugOutput.specular) + + +##### specular.SPECULAR\_FACTOR +output the specular factor + +**Kind**: static property of [specular](#GltfState.DebugOutput.specular) + + +##### specular.SPECULAR\_COLOR +output the specular color + +**Kind**: static property of [specular](#GltfState.DebugOutput.specular) + + +#### DebugOutput.transmission +output tranmission lighting **Kind**: static property of [DebugOutput](#GltfState.DebugOutput) - -#### DebugOutput.F0 -output computed F0 +* [.transmission](#GltfState.DebugOutput.transmission) + * [.TRANSMISSION_VOLUME](#GltfState.DebugOutput.transmission.TRANSMISSION_VOLUME) + * [.TRANSMISSION_FACTOR](#GltfState.DebugOutput.transmission.TRANSMISSION_FACTOR) + * [.VOLUME_THICKNESS](#GltfState.DebugOutput.transmission.VOLUME_THICKNESS) + + + +##### transmission.TRANSMISSION\_VOLUME +output the combined transmission/volume + +**Kind**: static property of [transmission](#GltfState.DebugOutput.transmission) + + +##### transmission.TRANSMISSION\_FACTOR +output the transmission factor + +**Kind**: static property of [transmission](#GltfState.DebugOutput.transmission) + + +##### transmission.VOLUME\_THICKNESS +output the volume thickness + +**Kind**: static property of [transmission](#GltfState.DebugOutput.transmission) + + +#### DebugOutput.iridescence +output tranmission lighting **Kind**: static property of [DebugOutput](#GltfState.DebugOutput) + +* [.iridescence](#GltfState.DebugOutput.iridescence) + * [.IRIDESCENCE](#GltfState.DebugOutput.iridescence.IRIDESCENCE) + * [.IRIDESCENCE_FACTOR](#GltfState.DebugOutput.iridescence.IRIDESCENCE_FACTOR) + * [.IRIDESCENCE_THICKNESS](#GltfState.DebugOutput.iridescence.IRIDESCENCE_THICKNESS) + + + +##### iridescence.IRIDESCENCE +output the combined iridescence + +**Kind**: static property of [iridescence](#GltfState.DebugOutput.iridescence) + + +##### iridescence.IRIDESCENCE\_FACTOR +output the iridescence factor + +**Kind**: static property of [iridescence](#GltfState.DebugOutput.iridescence) + + +##### iridescence.IRIDESCENCE\_THICKNESS +output the iridescence thickness + +**Kind**: static property of [iridescence](#GltfState.DebugOutput.iridescence) ## ResourceLoader diff --git a/package.json b/package.json index 0d122413..dd725e16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@khronosgroup/gltf-viewer", - "version": "1.0.7", + "version": "1.0.8", "description": "The official glTF sample viewer.", "main": "dist/gltf-viewer.js", "module": "dist/gltf-viewer.module.js", diff --git a/source/GltfState/gltf_state.js b/source/GltfState/gltf_state.js index e2640813..e674dc39 100644 --- a/source/GltfState/gltf_state.js +++ b/source/GltfState/gltf_state.js @@ -116,8 +116,11 @@ GltfState.DebugOutput = { /** standard rendering - debug output is disabled */ NONE: "None", + /** generic debug outputs */ generic: { + /** output the texture coordinates 0 */ UV_COORDS_0: "Texture Coordinates 0", + /** output the texture coordinates 1 */ UV_COORDS_1: "Texture Coordinates 1", /** output the world space normals (i.e. with TBN applied) */ NORMAL: "Normal Texture", @@ -137,7 +140,9 @@ GltfState.DebugOutput = { EMISSIVE: "Emissive", }, + /** output metallic roughness */ mr: { + /** output the combined metallic roughness */ METALLIC_ROUGHNESS: "Metallic Roughness", /** output the base color value */ BASECOLOR: "Base Color", @@ -149,37 +154,53 @@ GltfState.DebugOutput = { /** output clearcoat lighting */ clearcoat: { + /** output the combined clear coat */ CLEARCOAT: "ClearCoat", + /** output the clear coat factor */ CLEARCOAT_FACTOR: "ClearCoat Factor", + /** output the clear coat roughness */ CLEARCOAT_ROUGHNESS: "ClearCoat Roughness", + /** output the clear coat normal */ CLEARCOAT_NORMAL: "ClearCoat Normal", }, /** output sheen lighting */ sheen: { + /** output the combined sheen */ SHEEN: "Sheen", + /** output the sheen color*/ SHEEN_COLOR: "Sheen Color", + /** output the sheen roughness*/ SHEEN_ROUGHNESS: "Sheen Roughness", }, /** output specular lighting */ specular: { + /** output the combined specular */ SPECULAR: "Specular", + /** output the specular factor*/ SPECULAR_FACTOR: "Specular Factor", + /** output the specular color*/ SPECULAR_COLOR: "Specular Color", }, /** output tranmission lighting */ transmission: { + /** output the combined transmission/volume */ TRANSMISSION_VOLUME: "Transmission/Volume", + /** output the transmission factor*/ TRANSMISSION_FACTOR: "Transmission Factor", + /** output the volume thickness*/ VOLUME_THICKNESS: "Volume Thickness", }, /** output tranmission lighting */ iridescence: { + /** output the combined iridescence */ IRIDESCENCE: "Iridescence", + /** output the iridescence factor*/ IRIDESCENCE_FACTOR: "Iridescence Factor", + /** output the iridescence thickness*/ IRIDESCENCE_THICKNESS: "Iridescence Thickness", }, };