diff --git a/manual/assets/js/libs/vendor.ts b/manual/assets/js/libs/vendor.ts index a0d4ae098..26919c52d 100644 --- a/manual/assets/js/libs/vendor.ts +++ b/manual/assets/js/libs/vendor.ts @@ -1,5 +1,7 @@ export * from "three"; export * from "three/examples/jsm/loaders/GLTFLoader.js"; +export * from "three/examples/jsm/loaders/LUT3dlLoader.js"; +export * from "three/examples/jsm/loaders/LUTCubeLoader.js"; export { ControlMode, SpatialControls } from "spatial-controls"; export { Pane } from "tweakpane"; diff --git a/manual/assets/js/src/demos/lut.ts b/manual/assets/js/src/demos/lut.ts index eb1bbabdb..278c5f8b5 100644 --- a/manual/assets/js/src/demos/lut.ts +++ b/manual/assets/js/src/demos/lut.ts @@ -2,15 +2,15 @@ import { ClampToEdgeWrapping, LinearFilter, LoadingManager, - PerspectiveCamera, - PlaneGeometry, Mesh, MeshBasicMaterial, + PerspectiveCamera, + PlaneGeometry, Scene, + SRGBColorSpace, TextureLoader, - WebGLRenderer, Texture, - SRGBColorSpace + WebGLRenderer } from "three"; import { @@ -19,12 +19,12 @@ import { GeometryPass, LookupTexture, // LUT3DEffect, - LUT3dlLoader, - LUTCubeLoader, RawImageData, RenderPipeline } from "postprocessing"; +import { LUT3dlLoader } from "three/examples/jsm/loaders/LUT3dlLoader.js"; +import { LUTCubeLoader } from "three/examples/jsm/loaders/LUTCubeLoader.js"; import { Pane } from "tweakpane"; import * as EssentialsPlugin from "@tweakpane/plugin-essentials"; import { ControlMode, SpatialControls } from "spatial-controls"; @@ -90,21 +90,23 @@ function load(): Promise> { } else if(/.3dl$/im.test(entry[1])) { - lut3dlLoader.load(`${document.baseURI}img/textures/lut/${entry[1]}`, (t) => { + lut3dlLoader.load(`${document.baseURI}img/textures/lut/${entry[1]}`, (data) => { + const t = LookupTexture.from(data.texture3D); t.name = entry[0]; assets.set(entry[0], t); - }).catch((e) => console.error(e)); + }); } else if(/.cube$/im.test(entry[1])) { - lutCubeLoader.load(`${document.baseURI}img/textures/lut/${entry[1]}`, (t) => { + lutCubeLoader.load(`${document.baseURI}img/textures/lut/${entry[1]}`, (data) => { + const t = LookupTexture.from(data.texture3D); t.name = entry[0]; assets.set(entry[0], t); - }).catch((e) => console.error(e)); + }); } else { diff --git a/manual/assets/js/src/shims/require.ts b/manual/assets/js/src/shims/require.ts index 6e73a2fe8..c480bdda3 100644 --- a/manual/assets/js/src/shims/require.ts +++ b/manual/assets/js/src/shims/require.ts @@ -11,6 +11,8 @@ export function require(name: string): unknown { case "three": case "three/examples/jsm/loaders/GLTFLoader.js": + case "three/examples/jsm/loaders/LUT3dlLoader.js": + case "three/examples/jsm/loaders/LUTCubeLoader.js": case "tweakpane": case "spatial-controls": return window.VENDOR;