Skip to content

Commit

Permalink
Bump version to v1.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
NPM release bot committed Sep 3, 2024
1 parent 9f327a7 commit 6f0f7da
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 81 deletions.
146 changes: 68 additions & 78 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GltfView represents a view on a gltf, e.g. in a canvas
* [GltfView](#GltfView)
* [new GltfView(context)](#new_GltfView_new)
* [.createState()](#GltfView+createState)[<code>GltfState</code>](#GltfState)
* [.createResourceLoader([externalDracoLib], [externalKtxLib])](#GltfView+createResourceLoader)[<code>ResourceLoader</code>](#ResourceLoader)
* [.createResourceLoader([externalDracoLib], [externalKtxLib], [libPath])](#GltfView+createResourceLoader)[<code>ResourceLoader</code>](#ResourceLoader)
* [.renderFrame(state, width, height)](#GltfView+renderFrame)
* [.gatherStatistics(state)](#GltfView+gatherStatistics) ⇒ <code>Object</code>

Expand Down Expand Up @@ -54,7 +54,7 @@ GltfViews.
**Returns**: [<code>GltfState</code>](#GltfState) - GltfState
<a name="GltfView+createResourceLoader"></a>

### gltfView.createResourceLoader([externalDracoLib], [externalKtxLib]) ⇒ [<code>ResourceLoader</code>](#ResourceLoader)
### gltfView.createResourceLoader([externalDracoLib], [externalKtxLib], [libPath]) ⇒ [<code>ResourceLoader</code>](#ResourceLoader)
createResourceLoader creates a resource loader with which glTFs and
environments can be loaded for the view

Expand All @@ -65,6 +65,7 @@ environments can be loaded for the view
| --- | --- | --- |
| [externalDracoLib] | <code>Object</code> | optional object of an external Draco library, e.g. from a CDN |
| [externalKtxLib] | <code>Object</code> | optional object of an external KTX library, e.g. from a CDN |
| [libPath] | <code>string</code> | optional path to the libraries. Used to define the path to the WASM files on repackaging |

<a name="GltfView+renderFrame"></a>

Expand Down Expand Up @@ -147,29 +148,26 @@ GltfState containing a state for visualization in GltfView
* [.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)
* [.diffuseTransmission](#GltfState.DebugOutput.diffuseTransmission)
* [.DIFFUSE_TRANSMISSION_FACTOR](#GltfState.DebugOutput.diffuseTransmission.DIFFUSE_TRANSMISSION_FACTOR)
* [.DIFFUSE_TRANSMISSION_COLOR_FACTOR](#GltfState.DebugOutput.diffuseTransmission.DIFFUSE_TRANSMISSION_COLOR_FACTOR)
* [.iridescence](#GltfState.DebugOutput.iridescence)
* [.IRIDESCENCE](#GltfState.DebugOutput.iridescence.IRIDESCENCE)
* [.IRIDESCENCE_FACTOR](#GltfState.DebugOutput.iridescence.IRIDESCENCE_FACTOR)
* [.IRIDESCENCE_THICKNESS](#GltfState.DebugOutput.iridescence.IRIDESCENCE_THICKNESS)
* [.anisotropy](#GltfState.DebugOutput.anisotropy)
Expand Down Expand Up @@ -330,9 +328,9 @@ render some debug output channes, such as for example the normals
#### renderingParameters.environmentRotation
By default the front face of the environment is +Z (90)
Front faces:
+X = 0
+Z = 90
-X = 180
+X = 0
+Z = 90
-X = 180
-Z = 270

**Kind**: static property of [<code>renderingParameters</code>](#GltfState+renderingParameters)
Expand All @@ -351,7 +349,7 @@ MSAA used for cases which are not handled by the browser (e.g. Transmission)
<a name="GltfState.ToneMaps"></a>

### GltfState.ToneMaps
ToneMaps enum for the different tonemappings that are supported
ToneMaps enum for the different tonemappings that are supported
by gltf sample viewer

**Kind**: static property of [<code>GltfState</code>](#GltfState)
Expand Down Expand Up @@ -415,29 +413,26 @@ such as "NORMAL"
* [.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)
* [.diffuseTransmission](#GltfState.DebugOutput.diffuseTransmission)
* [.DIFFUSE_TRANSMISSION_FACTOR](#GltfState.DebugOutput.diffuseTransmission.DIFFUSE_TRANSMISSION_FACTOR)
* [.DIFFUSE_TRANSMISSION_COLOR_FACTOR](#GltfState.DebugOutput.diffuseTransmission.DIFFUSE_TRANSMISSION_COLOR_FACTOR)
* [.iridescence](#GltfState.DebugOutput.iridescence)
* [.IRIDESCENCE](#GltfState.DebugOutput.iridescence.IRIDESCENCE)
* [.IRIDESCENCE_FACTOR](#GltfState.DebugOutput.iridescence.IRIDESCENCE_FACTOR)
* [.IRIDESCENCE_THICKNESS](#GltfState.DebugOutput.iridescence.IRIDESCENCE_THICKNESS)
* [.anisotropy](#GltfState.DebugOutput.anisotropy)
Expand Down Expand Up @@ -532,22 +527,15 @@ output the emissive value
<a name="GltfState.DebugOutput.mr"></a>

#### DebugOutput.mr
output metallic roughness
metallic roughness

**Kind**: static property of [<code>DebugOutput</code>](#GltfState.DebugOutput)

* [.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)

<a name="GltfState.DebugOutput.mr.METALLIC_ROUGHNESS"></a>

##### mr.METALLIC\_ROUGHNESS
output the combined metallic roughness

**Kind**: static property of [<code>mr</code>](#GltfState.DebugOutput.mr)
<a name="GltfState.DebugOutput.mr.BASECOLOR"></a>

##### mr.BASECOLOR
Expand All @@ -569,26 +557,19 @@ output the roughness value from pbr metallic roughness
<a name="GltfState.DebugOutput.clearcoat"></a>

#### DebugOutput.clearcoat
output clearcoat lighting
KHR_materials_clearcoat

**Kind**: static property of [<code>DebugOutput</code>](#GltfState.DebugOutput)

* [.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)

<a name="GltfState.DebugOutput.clearcoat.CLEARCOAT"></a>

##### clearcoat.CLEARCOAT
output the combined clear coat

**Kind**: static property of [<code>clearcoat</code>](#GltfState.DebugOutput.clearcoat)
<a name="GltfState.DebugOutput.clearcoat.CLEARCOAT_FACTOR"></a>

##### clearcoat.CLEARCOAT\_FACTOR
output the clear coat factor
output the clear coat strength

**Kind**: static property of [<code>clearcoat</code>](#GltfState.DebugOutput.clearcoat)
<a name="GltfState.DebugOutput.clearcoat.CLEARCOAT_ROUGHNESS"></a>
Expand All @@ -606,21 +587,14 @@ output the clear coat normal
<a name="GltfState.DebugOutput.sheen"></a>

#### DebugOutput.sheen
output sheen lighting
KHR_materials_sheen

**Kind**: static property of [<code>DebugOutput</code>](#GltfState.DebugOutput)

* [.sheen](#GltfState.DebugOutput.sheen)
* [.SHEEN](#GltfState.DebugOutput.sheen.SHEEN)
* [.SHEEN_COLOR](#GltfState.DebugOutput.sheen.SHEEN_COLOR)
* [.SHEEN_ROUGHNESS](#GltfState.DebugOutput.sheen.SHEEN_ROUGHNESS)

<a name="GltfState.DebugOutput.sheen.SHEEN"></a>

##### sheen.SHEEN
output the combined sheen

**Kind**: static property of [<code>sheen</code>](#GltfState.DebugOutput.sheen)
<a name="GltfState.DebugOutput.sheen.SHEEN_COLOR"></a>

##### sheen.SHEEN\_COLOR
Expand All @@ -636,25 +610,18 @@ output the sheen roughness
<a name="GltfState.DebugOutput.specular"></a>

#### DebugOutput.specular
output specular lighting
KHR_materials_specular

**Kind**: static property of [<code>DebugOutput</code>](#GltfState.DebugOutput)

* [.specular](#GltfState.DebugOutput.specular)
* [.SPECULAR](#GltfState.DebugOutput.specular.SPECULAR)
* [.SPECULAR_FACTOR](#GltfState.DebugOutput.specular.SPECULAR_FACTOR)
* [.SPECULAR_COLOR](#GltfState.DebugOutput.specular.SPECULAR_COLOR)

<a name="GltfState.DebugOutput.specular.SPECULAR"></a>

##### specular.SPECULAR
output the combined specular

**Kind**: static property of [<code>specular</code>](#GltfState.DebugOutput.specular)
<a name="GltfState.DebugOutput.specular.SPECULAR_FACTOR"></a>

##### specular.SPECULAR\_FACTOR
output the specular factor
output the specular strength

**Kind**: static property of [<code>specular</code>](#GltfState.DebugOutput.specular)
<a name="GltfState.DebugOutput.specular.SPECULAR_COLOR"></a>
Expand All @@ -666,25 +633,18 @@ output the specular color
<a name="GltfState.DebugOutput.transmission"></a>

#### DebugOutput.transmission
output tranmission lighting
KHR_materials_transmission

**Kind**: static property of [<code>DebugOutput</code>](#GltfState.DebugOutput)

* [.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)

<a name="GltfState.DebugOutput.transmission.TRANSMISSION_VOLUME"></a>

##### transmission.TRANSMISSION\_VOLUME
output the combined transmission/volume

**Kind**: static property of [<code>transmission</code>](#GltfState.DebugOutput.transmission)
<a name="GltfState.DebugOutput.transmission.TRANSMISSION_FACTOR"></a>

##### transmission.TRANSMISSION\_FACTOR
output the transmission factor
output the transmission strength

**Kind**: static property of [<code>transmission</code>](#GltfState.DebugOutput.transmission)
<a name="GltfState.DebugOutput.transmission.VOLUME_THICKNESS"></a>
Expand All @@ -693,28 +653,44 @@ output the transmission factor
output the volume thickness

**Kind**: static property of [<code>transmission</code>](#GltfState.DebugOutput.transmission)
<a name="GltfState.DebugOutput.diffuseTransmission"></a>

#### DebugOutput.diffuseTransmission
KHR_materials_diffuse_tranmission

**Kind**: static property of [<code>DebugOutput</code>](#GltfState.DebugOutput)

* [.diffuseTransmission](#GltfState.DebugOutput.diffuseTransmission)
* [.DIFFUSE_TRANSMISSION_FACTOR](#GltfState.DebugOutput.diffuseTransmission.DIFFUSE_TRANSMISSION_FACTOR)
* [.DIFFUSE_TRANSMISSION_COLOR_FACTOR](#GltfState.DebugOutput.diffuseTransmission.DIFFUSE_TRANSMISSION_COLOR_FACTOR)

<a name="GltfState.DebugOutput.diffuseTransmission.DIFFUSE_TRANSMISSION_FACTOR"></a>

##### diffuseTransmission.DIFFUSE\_TRANSMISSION\_FACTOR
output the diffuse tranmission strength

**Kind**: static property of [<code>diffuseTransmission</code>](#GltfState.DebugOutput.diffuseTransmission)
<a name="GltfState.DebugOutput.diffuseTransmission.DIFFUSE_TRANSMISSION_COLOR_FACTOR"></a>

##### diffuseTransmission.DIFFUSE\_TRANSMISSION\_COLOR\_FACTOR
output the diffuse tranmission color factor

**Kind**: static property of [<code>diffuseTransmission</code>](#GltfState.DebugOutput.diffuseTransmission)
<a name="GltfState.DebugOutput.iridescence"></a>

#### DebugOutput.iridescence
output iridescence
KHR_materials_iridescence

**Kind**: static property of [<code>DebugOutput</code>](#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)

<a name="GltfState.DebugOutput.iridescence.IRIDESCENCE"></a>

##### iridescence.IRIDESCENCE
output the combined iridescence

**Kind**: static property of [<code>iridescence</code>](#GltfState.DebugOutput.iridescence)
<a name="GltfState.DebugOutput.iridescence.IRIDESCENCE_FACTOR"></a>

##### iridescence.IRIDESCENCE\_FACTOR
output the iridescence factor
output the iridescence strength

**Kind**: static property of [<code>iridescence</code>](#GltfState.DebugOutput.iridescence)
<a name="GltfState.DebugOutput.iridescence.IRIDESCENCE_THICKNESS"></a>
Expand All @@ -726,7 +702,7 @@ output the iridescence thickness
<a name="GltfState.DebugOutput.anisotropy"></a>

#### DebugOutput.anisotropy
output anisotropy
KHR_materials_anisotropy

**Kind**: static property of [<code>DebugOutput</code>](#GltfState.DebugOutput)

Expand Down Expand Up @@ -755,24 +731,25 @@ that are then used to display the loaded data with GltfView
**Kind**: global class

* [ResourceLoader](#ResourceLoader)
* [new ResourceLoader(view)](#new_ResourceLoader_new)
* [new ResourceLoader(view, libPath)](#new_ResourceLoader_new)
* [.loadGltf(gltfFile, [externalFiles])](#ResourceLoader+loadGltf) ⇒ <code>Promise</code>
* [.loadEnvironment(environmentFile, [lutFiles])](#ResourceLoader+loadEnvironment) ⇒ <code>Promise</code>
* [.initKtxLib([externalKtxLib])](#ResourceLoader+initKtxLib)
* [.initDracoLib([externalDracoLib])](#ResourceLoader+initDracoLib)

<a name="new_ResourceLoader_new"></a>

### new ResourceLoader(view)
### new ResourceLoader(view, libPath)
ResourceLoader class that provides an interface to load resources into
the view. Typically this is created with GltfView.createResourceLoader()
You cannot share resource loaders between GltfViews as some of the resources
are allocated directly on the WebGl2 Context


| Param | Type | Description |
| --- | --- | --- |
| view | <code>Object</code> | the GltfView for which the resources are loaded |
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| view | <code>Object</code> | | the GltfView for which the resources are loaded |
| libPath | <code>String</code> | <code>./libs/</code> | path to the lib folder. This can be used to find the WASM files if sample viewer is repackaged |

<a name="ResourceLoader+loadGltf"></a>

Expand Down Expand Up @@ -842,6 +819,7 @@ initDracoLib must be called before loading gltf files with draco meshes
* [.zoomBy(value)](#UserCamera+zoomBy)
* [.orbit(x, y)](#UserCamera+orbit)
* [.pan(x, y)](#UserCamera+pan)
* [.resetView(gltf, sceneIndex)](#UserCamera+resetView)
* [.fitViewToScene(gltf, sceneIndex)](#UserCamera+fitViewToScene)

<a name="new_UserCamera_new"></a>
Expand Down Expand Up @@ -989,9 +967,9 @@ The axes are inverted: e.g. if y is positive the camera will move down.
| x | <code>number</code> |
| y | <code>number</code> |

<a name="UserCamera+fitViewToScene"></a>
<a name="UserCamera+resetView"></a>

### userCamera.fitViewToScene(gltf, sceneIndex)
### userCamera.resetView(gltf, sceneIndex)
Calculates a camera position which looks at the center of the scene from an appropriate distance.
This calculates near and far plane as well.

Expand All @@ -1002,3 +980,15 @@ This calculates near and far plane as well.
| gltf | <code>Gltf</code> |
| sceneIndex | <code>number</code> |

<a name="UserCamera+fitViewToScene"></a>

### userCamera.fitViewToScene(gltf, sceneIndex)
Fit view to updated canvas size without changing rotation if distance is incorrect

**Kind**: instance method of [<code>UserCamera</code>](#UserCamera)

| Param | Type |
| --- | --- |
| gltf | <code>Gltf</code> |
| sceneIndex | <code>number</code> |

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@khronosgroup/gltf-viewer",
"version": "1.0.10",
"version": "1.0.11",
"description": "The official glTF sample viewer.",
"main": "dist/gltf-viewer.js",
"module": "dist/gltf-viewer.module.js",
Expand Down

0 comments on commit 6f0f7da

Please sign in to comment.