@gltf-transform/view
Advanced tools
+2
-2
@@ -1,3 +0,3 @@ | ||
| import { Document, ExtensionProperty, Material, Mesh, Node, Primitive, Scene, Skin, Texture } from "@gltf-transform/core"; | ||
| import { BufferAttribute, BufferGeometry, CompressedTexture, DirectionalLight, Group, InstancedMesh, Line, LineLoop, LineSegments, Material as Material$1, Mesh as Mesh$1, Object3D, PointLight, Points, Skeleton, SkinnedMesh, SpotLight, Texture as Texture$1 } from "three"; | ||
| import { Document, Material, Mesh, Node, Primitive, Scene, Texture } from "@gltf-transform/core"; | ||
| import { BufferGeometry, CompressedTexture, DirectionalLight, Group, Line, LineLoop, LineSegments, Material as Material$1, Mesh as Mesh$1, Object3D, PointLight, Points, SkinnedMesh, SpotLight, Texture as Texture$1 } from "three"; | ||
| import { KTX2Loader } from "three/examples/jsm/loaders/KTX2Loader.js"; | ||
@@ -4,0 +4,0 @@ import { Light } from "@gltf-transform/extensions"; |
+9
-15
@@ -791,8 +791,2 @@ import { ExtensionProperty, Primitive, PropertyType, Skin, uuid } from "@gltf-transform/core"; | ||
| ]; | ||
| var ShadingModel = /* @__PURE__ */ function(ShadingModel) { | ||
| ShadingModel[ShadingModel["UNLIT"] = 0] = "UNLIT"; | ||
| ShadingModel[ShadingModel["STANDARD"] = 1] = "STANDARD"; | ||
| ShadingModel[ShadingModel["PHYSICAL"] = 2] = "PHYSICAL"; | ||
| return ShadingModel; | ||
| }(ShadingModel || {}); | ||
| /** @internal */ | ||
@@ -872,5 +866,5 @@ var MaterialSubject = class MaterialSubject extends Subject { | ||
| switch (getShadingModel(def)) { | ||
| case ShadingModel.UNLIT: return pool.requestBase(new MeshBasicMaterial()); | ||
| case ShadingModel.STANDARD: return pool.requestBase(new MeshStandardMaterial()); | ||
| case ShadingModel.PHYSICAL: return pool.requestBase(new MeshPhysicalMaterial()); | ||
| case 0: return pool.requestBase(new MeshBasicMaterial()); | ||
| case 1: return pool.requestBase(new MeshStandardMaterial()); | ||
| case 2: return pool.requestBase(new MeshPhysicalMaterial()); | ||
| default: throw new Error("Unsupported shading model."); | ||
@@ -884,3 +878,3 @@ } | ||
| const shadingModel = getShadingModel(def); | ||
| if (shadingModel === ShadingModel.UNLIT && value.type !== "MeshBasicMaterial" || shadingModel === ShadingModel.STANDARD && value.type !== "MeshStandardMaterial" || shadingModel === ShadingModel.PHYSICAL && value.type !== "MeshPhysicalMaterial") { | ||
| if (shadingModel === 0 && value.type !== "MeshBasicMaterial" || shadingModel === 1 && value.type !== "MeshStandardMaterial" || shadingModel === 2 && value.type !== "MeshPhysicalMaterial") { | ||
| this.pool.releaseBase(this.value); | ||
@@ -892,4 +886,4 @@ this.value = MaterialSubject.createValue(def, this.pool); | ||
| switch (shadingModel) { | ||
| case ShadingModel.PHYSICAL: this._updatePhysical(value); | ||
| case ShadingModel.STANDARD: this._updateStandard(value); | ||
| case 2: this._updatePhysical(value); | ||
| case 1: this._updateStandard(value); | ||
| default: this._updateBasic(value); | ||
@@ -1021,3 +1015,3 @@ } | ||
| for (const extension of def.listExtensions()) switch (extension.extensionName) { | ||
| case "KHR_materials_unlit": return ShadingModel.UNLIT; | ||
| case "KHR_materials_unlit": return 0; | ||
| case "KHR_materials_anisotropy": | ||
@@ -1030,5 +1024,5 @@ case "KHR_materials_clearcoat": | ||
| case "KHR_materials_transmission": | ||
| case "KHR_materials_volume": return ShadingModel.PHYSICAL; | ||
| case "KHR_materials_volume": return 2; | ||
| } | ||
| return ShadingModel.STANDARD; | ||
| return 1; | ||
| } | ||
@@ -1035,0 +1029,0 @@ //#endregion |
+2
-2
| { | ||
| "name": "@gltf-transform/view", | ||
| "version": "4.4.0", | ||
| "version": "4.4.1", | ||
| "repository": "github:donmccurdy/glTF-Transform-View", | ||
@@ -35,3 +35,3 @@ "homepage": "https://gltf-transform.dev/", | ||
| }, | ||
| "gitHead": "8f2d40ca328b87ec6204adf09b87e7e19dcff8d3" | ||
| "gitHead": "0b533a10fc8266dce426eeb6f36c807057b88da5" | ||
| } |
@@ -33,2 +33,3 @@ import type { | ||
| /** @internal */ | ||
| export interface DocumentViewSubjectAPI { | ||
@@ -35,0 +36,0 @@ readonly accessorPool: Pool<BufferAttribute>; |
152751
-0.35%4044
-0.12%