From 2a95aa0b9b346cd9f4103629ff6ad68cc06ac175 Mon Sep 17 00:00:00 2001 From: MasatoMakino Date: Sun, 28 Jan 2024 17:12:25 +0900 Subject: [PATCH 1/3] change : type module --- package.json | 16 ++++++++++------ src/bloom/BloomEffectComposer.ts | 12 +++++------- src/bloom/MaterialSwitcher.ts | 4 ++-- src/bloom/index.ts | 2 +- .../ChromaticAberration.frag.glsl.ts | 2 +- .../ChromaticAberrationShader.ts | 8 ++++---- .../ChromaticAberrationShaderPass.ts | 4 ++-- src/chromaticAberration/index.ts | 2 +- src/colorFilter/ColorFilter.frag.glsl.ts | 2 +- src/colorFilter/ColorFilterShader.ts | 8 ++++---- src/colorFilter/ColorFilterShaderPass.ts | 4 ++-- src/colorFilter/index.ts | 2 +- src/displacement/DisplacementMap.frag.glsl.ts | 2 +- src/displacement/DisplacementMapShader.ts | 8 ++++---- src/displacement/DisplacementMapShaderPass.ts | 6 +++--- src/displacement/index.ts | 2 +- src/fxaa/FXAAShaderPass.ts | 4 ++-- src/fxaa/index.ts | 2 +- src/index.ts | 18 +++++++++--------- src/mix/MixShader.ts | 8 ++++---- src/mix/MixShaderPass.ts | 4 ++-- src/mix/index.ts | 2 +- src/monotone/MonotoneShader.ts | 8 ++++---- src/monotone/MonotoneShaderPass.ts | 4 ++-- src/monotone/index.ts | 2 +- src/peripheralLight/PeripheralLightShader.ts | 8 ++++---- .../PeripheralLightShaderPass.ts | 4 ++-- src/peripheralLight/index.ts | 2 +- src/postprocess/PostProcessEffectComposer.ts | 2 +- src/postprocess/PostProcessRenderer.ts | 12 ++++++------ src/postprocess/PostProcessShaderPass.ts | 2 +- src/postprocess/index.ts | 6 +++--- tsconfig.esm.json | 9 --------- tsconfig.json | 11 +++++------ 34 files changed, 92 insertions(+), 100 deletions(-) delete mode 100644 tsconfig.esm.json diff --git a/package.json b/package.json index 38f2329..618f0ae 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,15 @@ "name": "threejs-postprocess", "discription": "Collection of post process modules for three.js", "version": "0.3.0", - "main": "./lib/index.js", - "types": "./lib/index.d.ts", - "module": "./esm/index.js", + "type": "module", + "exports": { + ".": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + } + }, + "types": "./esm/index.d.ts", "files": [ - "lib", "esm" ], "repository": "https://MasatoMakino@github.com/MasatoMakino/threejs-postprocess.git", @@ -30,8 +34,8 @@ "scripts": { "start:dev": "npm run server & npm run watch:tsc & npm run watch:demo", "build": "npm run buildTS && npm run demo && npm run typedocs", - "buildTS": "tsc --project tsconfig.json & tsc --project tsconfig.esm.json", - "watch:tsc": "tsc -W --incremental --project tsconfig.json & tsc -W --incremental --project tsconfig.esm.json", + "buildTS": "tsc", + "watch:tsc": "tsc -W --incremental", "demo": "npx @masatomakino/gulptask-demo-page --body ''", "watch:demo": "npm run demo -- -W", "typedocs": "npx typedoc --out ./docs/api src/index.ts", diff --git a/src/bloom/BloomEffectComposer.ts b/src/bloom/BloomEffectComposer.ts index 2001e4f..f48d967 100644 --- a/src/bloom/BloomEffectComposer.ts +++ b/src/bloom/BloomEffectComposer.ts @@ -1,8 +1,8 @@ import { Vector2, WebGLRenderer, Scene, Texture } from "three"; -import { PostProcessEffectComposer } from "../postprocess/PostProcessEffectComposer"; -import { UnrealBloomPass } from "three/examples/jsm/postprocessing/UnrealBloomPass"; -import { RenderPassOption } from "../postprocess"; -import { MaterialSwitcher } from "./MaterialSwitcher"; +import { PostProcessEffectComposer } from "../postprocess/PostProcessEffectComposer.js"; +import { UnrealBloomPass } from "three/examples/jsm/postprocessing/UnrealBloomPass.js"; +import { RenderPassOption } from "../postprocess/index.js"; +import { MaterialSwitcher } from "./MaterialSwitcher.js"; /** * 切り替え可能なUnrealBloomPassを内包したEffectComposer. @@ -18,7 +18,7 @@ export class BloomEffectComposer extends PostProcessEffectComposer { constructor( scene: Scene, renderer: WebGLRenderer, - renderPassOption: RenderPassOption + renderPassOption: RenderPassOption, ) { super(renderer); @@ -27,8 +27,6 @@ export class BloomEffectComposer extends PostProcessEffectComposer { const size = renderer.getSize(new Vector2()); this.bloomPass = new UnrealBloomPass(size, 1.5, 0.4, 0.4); - // TODO : PR d.ts - // @ts-ignore this.renderToScreen = false; RenderPassOption.init(renderPassOption); diff --git a/src/bloom/MaterialSwitcher.ts b/src/bloom/MaterialSwitcher.ts index ee80b42..64fefff 100644 --- a/src/bloom/MaterialSwitcher.ts +++ b/src/bloom/MaterialSwitcher.ts @@ -1,6 +1,6 @@ import { Scene, Layers, Object3D, Mesh } from "three"; -import { BloomEffectComposer } from "./BloomEffectComposer"; -import { MaterialStorage } from "./MaterialStorage"; +import { BloomEffectComposer } from "./BloomEffectComposer.js"; +import { MaterialStorage } from "./MaterialStorage.js"; /** * 切り替え可能なUnrealBloomPassにおいて、マテリアルの切り替え処理を担当するクラス。 diff --git a/src/bloom/index.ts b/src/bloom/index.ts index 9b5c17a..27143fc 100644 --- a/src/bloom/index.ts +++ b/src/bloom/index.ts @@ -1 +1 @@ -export * from "./BloomEffectComposer"; +export * from "./BloomEffectComposer.js"; diff --git a/src/chromaticAberration/ChromaticAberration.frag.glsl.ts b/src/chromaticAberration/ChromaticAberration.frag.glsl.ts index 551e98b..f634c27 100644 --- a/src/chromaticAberration/ChromaticAberration.frag.glsl.ts +++ b/src/chromaticAberration/ChromaticAberration.frag.glsl.ts @@ -1,6 +1,6 @@ export default () => { //language=GLSL - return ` + return /* GLSL */ ` uniform sampler2D tDiffuse; uniform float rate; uniform float radiusInner; diff --git a/src/chromaticAberration/ChromaticAberrationShader.ts b/src/chromaticAberration/ChromaticAberrationShader.ts index 7a893b1..15d40af 100644 --- a/src/chromaticAberration/ChromaticAberrationShader.ts +++ b/src/chromaticAberration/ChromaticAberrationShader.ts @@ -1,6 +1,6 @@ import { UniformsUtils } from "three"; -import { PostProcessShader } from "../index"; -import FragmentShader from "./ChromaticAberration.frag.glsl"; +import { PostProcessShader } from "../index.js"; +import FragmentShader from "./ChromaticAberration.frag.glsl.js"; export class ChromaticAberrationShader extends PostProcessShader { constructor() { @@ -15,8 +15,8 @@ export class ChromaticAberrationShader extends PostProcessShader { { rate: { value: 1.0 }, radiusInner: { value: 0.25 }, - radiusOuter: { value: Math.sqrt(2.0) } - } + radiusOuter: { value: Math.sqrt(2.0) }, + }, ]); } } diff --git a/src/chromaticAberration/ChromaticAberrationShaderPass.ts b/src/chromaticAberration/ChromaticAberrationShaderPass.ts index 714a068..c82b8ae 100644 --- a/src/chromaticAberration/ChromaticAberrationShaderPass.ts +++ b/src/chromaticAberration/ChromaticAberrationShaderPass.ts @@ -1,5 +1,5 @@ -import { ChromaticAberrationShader } from "./ChromaticAberrationShader"; -import { PostProcessShaderPass } from "../index"; +import { ChromaticAberrationShader } from "./ChromaticAberrationShader.js"; +import { PostProcessShaderPass } from "../index.js"; export class ChromaticAberrationShaderPass extends PostProcessShaderPass { get rate(): number { diff --git a/src/chromaticAberration/index.ts b/src/chromaticAberration/index.ts index ac65f92..20ed11e 100644 --- a/src/chromaticAberration/index.ts +++ b/src/chromaticAberration/index.ts @@ -1 +1 @@ -export * from "./ChromaticAberrationShaderPass"; +export * from "./ChromaticAberrationShaderPass.js"; diff --git a/src/colorFilter/ColorFilter.frag.glsl.ts b/src/colorFilter/ColorFilter.frag.glsl.ts index 22ff1cf..59570bb 100644 --- a/src/colorFilter/ColorFilter.frag.glsl.ts +++ b/src/colorFilter/ColorFilter.frag.glsl.ts @@ -1,6 +1,6 @@ export default () => { //language=GLSL - return ` + return /* GLSL */ ` uniform sampler2D tDiffuse; varying vec2 vUv; diff --git a/src/colorFilter/ColorFilterShader.ts b/src/colorFilter/ColorFilterShader.ts index c444555..6f00ad1 100644 --- a/src/colorFilter/ColorFilterShader.ts +++ b/src/colorFilter/ColorFilterShader.ts @@ -1,6 +1,6 @@ import { UniformsUtils } from "three"; -import { PostProcessShader } from "../index"; -import FragmentShader from "./ColorFilter.frag.glsl"; +import { PostProcessShader } from "../index.js"; +import FragmentShader from "./ColorFilter.frag.glsl.js"; export class ColorFilterShader extends PostProcessShader { constructor() { @@ -17,8 +17,8 @@ export class ColorFilterShader extends PostProcessShader { multiS: { value: 1.0 }, multiB: { value: 1.0 }, addS: { value: 0.0 }, - addB: { value: 0.0 } - } + addB: { value: 0.0 }, + }, ]); } } diff --git a/src/colorFilter/ColorFilterShaderPass.ts b/src/colorFilter/ColorFilterShaderPass.ts index aa0f86b..c4fe292 100644 --- a/src/colorFilter/ColorFilterShaderPass.ts +++ b/src/colorFilter/ColorFilterShaderPass.ts @@ -1,5 +1,5 @@ -import { ColorFilterShader } from "./ColorFilterShader"; -import { PostProcessShaderPass } from "../index"; +import { ColorFilterShader } from "./ColorFilterShader.js"; +import { PostProcessShaderPass } from "../index.js"; /** * hsb値をオフセットして、色を変化させるシェーダーパス diff --git a/src/colorFilter/index.ts b/src/colorFilter/index.ts index 51bf90f..b266ed5 100644 --- a/src/colorFilter/index.ts +++ b/src/colorFilter/index.ts @@ -1 +1 @@ -export * from "./ColorFilterShaderPass"; +export * from "./ColorFilterShaderPass.js"; diff --git a/src/displacement/DisplacementMap.frag.glsl.ts b/src/displacement/DisplacementMap.frag.glsl.ts index 47198f3..1404a43 100644 --- a/src/displacement/DisplacementMap.frag.glsl.ts +++ b/src/displacement/DisplacementMap.frag.glsl.ts @@ -1,6 +1,6 @@ export default () => { //language=GLSL - return ` + return /* GLSL */ ` uniform sampler2D tDiffuse; varying vec2 vUv; diff --git a/src/displacement/DisplacementMapShader.ts b/src/displacement/DisplacementMapShader.ts index feb5290..58415a6 100644 --- a/src/displacement/DisplacementMapShader.ts +++ b/src/displacement/DisplacementMapShader.ts @@ -1,6 +1,6 @@ import { UniformsUtils, Color } from "three"; -import { PostProcessShader } from "../index"; -import FragmentShader from "./DisplacementMap.frag.glsl"; +import { PostProcessShader } from "../index.js"; +import FragmentShader from "./DisplacementMap.frag.glsl.js"; import { Vector2 } from "three"; export class DisplacementMapShader extends PostProcessShader { @@ -18,8 +18,8 @@ export class DisplacementMapShader extends PostProcessShader { strengthY: { value: 0.0 }, map: { value: null }, hasMap: { value: false }, - aspect: { value: new Vector2(1.0, 1.0) } - } + aspect: { value: new Vector2(1.0, 1.0) }, + }, ]); } } diff --git a/src/displacement/DisplacementMapShaderPass.ts b/src/displacement/DisplacementMapShaderPass.ts index a62ae0e..c80a5ff 100644 --- a/src/displacement/DisplacementMapShaderPass.ts +++ b/src/displacement/DisplacementMapShaderPass.ts @@ -1,5 +1,5 @@ -import { DisplacementMapShader } from "./DisplacementMapShader"; -import { PostProcessShaderPass } from "../index"; +import { DisplacementMapShader } from "./DisplacementMapShader.js"; +import { PostProcessShaderPass } from "../index.js"; import { Texture, TextureLoader } from "three"; import { Vector2 } from "three"; @@ -23,7 +23,7 @@ export class DisplacementMapShaderPass extends PostProcessShaderPass { * @param url */ loadMap(url: string) { - const texture = new TextureLoader().load(url, texture => { + const texture = new TextureLoader().load(url, (texture) => { this.mapSizeW = texture.image.width; this.mapSizeH = texture.image.height; this.updateAspect(); diff --git a/src/displacement/index.ts b/src/displacement/index.ts index 4db235b..44f1d80 100644 --- a/src/displacement/index.ts +++ b/src/displacement/index.ts @@ -1 +1 @@ -export * from "./DisplacementMapShaderPass"; +export * from "./DisplacementMapShaderPass.js"; diff --git a/src/fxaa/FXAAShaderPass.ts b/src/fxaa/FXAAShaderPass.ts index 903607d..96b03db 100644 --- a/src/fxaa/FXAAShaderPass.ts +++ b/src/fxaa/FXAAShaderPass.ts @@ -1,6 +1,6 @@ -import * as FXAAShaderModule from "three/examples/jsm/shaders/FXAAShader"; +import * as FXAAShaderModule from "three/examples/jsm/shaders/FXAAShader.js"; import { ShaderMaterial } from "three"; -import { PostProcessShaderPass } from "../postprocess"; +import { PostProcessShaderPass } from "../postprocess/index.js"; /** * FXAAShaderを組み込み済みのShaderPass diff --git a/src/fxaa/index.ts b/src/fxaa/index.ts index 3fa3a90..040fed5 100644 --- a/src/fxaa/index.ts +++ b/src/fxaa/index.ts @@ -1 +1 @@ -export * from "./FXAAShaderPass"; +export * from "./FXAAShaderPass.js"; diff --git a/src/index.ts b/src/index.ts index 774f1ff..9f1680d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,9 @@ -export * from "./postprocess/"; -export * from "./peripheralLight/"; -export * from "./chromaticAberration/"; -export * from "./mix/"; -export * from "./bloom/"; -export * from "./fxaa/"; -export * from "./displacement/"; -export * from "./colorFilter/"; -export * from "./monotone/"; +export * from "./postprocess/index.js"; +export * from "./peripheralLight/index.js"; +export * from "./chromaticAberration/index.js"; +export * from "./mix/index.js"; +export * from "./bloom/index.js"; +export * from "./fxaa/index.js"; +export * from "./displacement/index.js"; +export * from "./colorFilter/index.js"; +export * from "./monotone/index.js"; diff --git a/src/mix/MixShader.ts b/src/mix/MixShader.ts index e3c368d..856b8eb 100644 --- a/src/mix/MixShader.ts +++ b/src/mix/MixShader.ts @@ -1,5 +1,5 @@ -import { PostProcessShader } from "../index"; -import FragmentShader from "./MixShader.frag.glsl"; +import { PostProcessShader } from "../index.js"; +import FragmentShader from "./MixShader.frag.glsl.js"; import { UniformsUtils } from "three"; export class MixShader extends PostProcessShader { @@ -13,8 +13,8 @@ export class MixShader extends PostProcessShader { this.uniforms = UniformsUtils.merge([ this.uniforms, { - mixTexture: { value: null } - } + mixTexture: { value: null }, + }, ]); } } diff --git a/src/mix/MixShaderPass.ts b/src/mix/MixShaderPass.ts index 7233026..b6c2d26 100644 --- a/src/mix/MixShaderPass.ts +++ b/src/mix/MixShaderPass.ts @@ -1,6 +1,6 @@ -import { PostProcessShaderPass } from "../index"; +import { PostProcessShaderPass } from "../index.js"; import { Texture } from "three"; -import { MixShader } from "./MixShader"; +import { MixShader } from "./MixShader.js"; /** * 他のエフェクトコンポーザーの描画結果を受け取り、自身のレンダリング結果に乗算するShaderPass diff --git a/src/mix/index.ts b/src/mix/index.ts index 8527f61..71d1154 100644 --- a/src/mix/index.ts +++ b/src/mix/index.ts @@ -1 +1 @@ -export * from "./MixShaderPass"; +export * from "./MixShaderPass.js"; diff --git a/src/monotone/MonotoneShader.ts b/src/monotone/MonotoneShader.ts index d41b245..bc2a73b 100644 --- a/src/monotone/MonotoneShader.ts +++ b/src/monotone/MonotoneShader.ts @@ -1,6 +1,6 @@ import { UniformsUtils, Color } from "three"; -import { PostProcessShader } from "../index"; -import FragmentShader from "./Monotone.frag.glsl"; +import { PostProcessShader } from "../index.js"; +import FragmentShader from "./Monotone.frag.glsl.js"; export class MonotoneShader extends PostProcessShader { constructor() { @@ -14,8 +14,8 @@ export class MonotoneShader extends PostProcessShader { this.uniforms, { strength: { value: 1.0 }, - color: { value: new Color(0xffffff) } - } + color: { value: new Color(0xffffff) }, + }, ]); } } diff --git a/src/monotone/MonotoneShaderPass.ts b/src/monotone/MonotoneShaderPass.ts index f51803e..1c63cd5 100644 --- a/src/monotone/MonotoneShaderPass.ts +++ b/src/monotone/MonotoneShaderPass.ts @@ -1,5 +1,5 @@ -import { MonotoneShader } from "./MonotoneShader"; -import { PostProcessShaderPass } from "../index"; +import { MonotoneShader } from "./MonotoneShader.js"; +import { PostProcessShaderPass } from "../index.js"; import { Color } from "three"; /** diff --git a/src/monotone/index.ts b/src/monotone/index.ts index ae19831..e4e4c30 100644 --- a/src/monotone/index.ts +++ b/src/monotone/index.ts @@ -1 +1 @@ -export * from "./MonotoneShaderPass"; +export * from "./MonotoneShaderPass.js"; diff --git a/src/peripheralLight/PeripheralLightShader.ts b/src/peripheralLight/PeripheralLightShader.ts index a5e5514..ea2f0d2 100644 --- a/src/peripheralLight/PeripheralLightShader.ts +++ b/src/peripheralLight/PeripheralLightShader.ts @@ -1,6 +1,6 @@ import { UniformsUtils, Color } from "three"; -import { PostProcessShader } from "../index"; -import FragmentShader from "./PeripheralLight.frag.glsl"; +import { PostProcessShader } from "../index.js"; +import FragmentShader from "./PeripheralLight.frag.glsl.js"; export class PeripheralLightShader extends PostProcessShader { constructor() { @@ -16,8 +16,8 @@ export class PeripheralLightShader extends PostProcessShader { rate: { value: 5.0 }, radiusInner: { value: 0.75 }, radiusOuter: { value: Math.sqrt(2.0) }, - color: { value: new Color(0, 0, 0) } - } + color: { value: new Color(0, 0, 0) }, + }, ]); } } diff --git a/src/peripheralLight/PeripheralLightShaderPass.ts b/src/peripheralLight/PeripheralLightShaderPass.ts index a85e8d8..e4e0904 100644 --- a/src/peripheralLight/PeripheralLightShaderPass.ts +++ b/src/peripheralLight/PeripheralLightShaderPass.ts @@ -1,6 +1,6 @@ -import { PeripheralLightShader } from "./PeripheralLightShader"; +import { PeripheralLightShader } from "./PeripheralLightShader.js"; import { Color } from "three"; -import { PostProcessShaderPass } from "../index"; +import { PostProcessShaderPass } from "../index.js"; /** * 周辺光量の減光を表現するフィルタ。 diff --git a/src/peripheralLight/index.ts b/src/peripheralLight/index.ts index abb8583..ac349cc 100644 --- a/src/peripheralLight/index.ts +++ b/src/peripheralLight/index.ts @@ -1 +1 @@ -export * from "./PeripheralLightShaderPass"; +export * from "./PeripheralLightShaderPass.js"; diff --git a/src/postprocess/PostProcessEffectComposer.ts b/src/postprocess/PostProcessEffectComposer.ts index 3caaf67..ebf46b7 100644 --- a/src/postprocess/PostProcessEffectComposer.ts +++ b/src/postprocess/PostProcessEffectComposer.ts @@ -1,4 +1,4 @@ -import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer"; +import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer.js"; /** * レンダリングの前後に任意の処理を実行する機能を追加したEffectComposer. diff --git a/src/postprocess/PostProcessRenderer.ts b/src/postprocess/PostProcessRenderer.ts index 989cf3e..f1457aa 100644 --- a/src/postprocess/PostProcessRenderer.ts +++ b/src/postprocess/PostProcessRenderer.ts @@ -5,9 +5,9 @@ import { Vector2, Camera, } from "three"; -import { RenderPass } from "three/examples/jsm/postprocessing/RenderPass"; -import { Pass } from "three/examples/jsm/postprocessing/Pass"; -import { PostProcessEffectComposer } from "./PostProcessEffectComposer"; +import { RenderPass } from "three/examples/jsm/postprocessing/RenderPass.js"; +import { Pass } from "three/examples/jsm/postprocessing/Pass.js"; +import { PostProcessEffectComposer } from "./PostProcessEffectComposer.js"; import { RAFTickerEventContext } from "@masatomakino/raf-ticker"; /** @@ -27,7 +27,7 @@ export class PostProcessRenderer { constructor( scene: Scene, camera: PerspectiveCamera, - renderer: WebGLRenderer + renderer: WebGLRenderer, ) { this.renderer = renderer; this.scene = scene; @@ -41,7 +41,7 @@ export class PostProcessRenderer { */ public addComposer( passes: Pass[], - renderPass?: RenderPass + renderPass?: RenderPass, ): PostProcessEffectComposer { const composer = PostProcessRenderer.getComposer(passes, this.renderer, { scene: this.scene, @@ -62,7 +62,7 @@ export class PostProcessRenderer { public static getComposer( passes: Pass[], renderer: WebGLRenderer, - renderPassOption: RenderPassOption + renderPassOption: RenderPassOption, ): PostProcessEffectComposer { RenderPassOption.init(renderPassOption); const composer = new PostProcessEffectComposer(renderer); diff --git a/src/postprocess/PostProcessShaderPass.ts b/src/postprocess/PostProcessShaderPass.ts index 92ed213..7c4839e 100644 --- a/src/postprocess/PostProcessShaderPass.ts +++ b/src/postprocess/PostProcessShaderPass.ts @@ -1,5 +1,5 @@ import { IUniform } from "three"; -import { ShaderPass } from "three/examples/jsm/postprocessing/ShaderPass"; +import { ShaderPass } from "three/examples/jsm/postprocessing/ShaderPass.js"; import { Texture } from "three"; export class PostProcessShaderPass extends ShaderPass { diff --git a/src/postprocess/index.ts b/src/postprocess/index.ts index fd3a2b6..42180ec 100644 --- a/src/postprocess/index.ts +++ b/src/postprocess/index.ts @@ -1,3 +1,3 @@ -export * from "./PostProcessRenderer"; -export * from "./PostProcessShader"; -export * from "./PostProcessShaderPass"; +export * from "./PostProcessRenderer.js"; +export * from "./PostProcessShader.js"; +export * from "./PostProcessShaderPass.js"; diff --git a/tsconfig.esm.json b/tsconfig.esm.json deleted file mode 100644 index b5d287b..0000000 --- a/tsconfig.esm.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "es2015", - "outDir": "./esm", - "declaration": false, - "declarationMap": false - } -} diff --git a/tsconfig.json b/tsconfig.json index b9cf2b0..08b5ebe 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,15 +2,14 @@ "compilerOptions": { /* Basic Options */ "lib": ["DOM"], - "target": "ES2015", - "module": "commonjs", + "target": "ES2021", + "module": "Node16", "declaration": true /* Generates corresponding '.d.ts' file. */, "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, - "outDir": "./lib" /* Redirect output structure to the directory. */, - "rootDir": "./src", - + "outDir": "./esm" /* Redirect output structure to the directory. */, + /* Module Resolution Options */ - "moduleResolution": "node", + "moduleResolution": "Node16", "esModuleInterop": true, "skipLibCheck": true }, From 60d311091a71fbc3d38f79e59a246ae807c5fd61 Mon Sep 17 00:00:00 2001 From: MasatoMakino Date: Sun, 28 Jan 2024 17:15:17 +0900 Subject: [PATCH 2/3] remove : lib --- .gitignore | 3 +- lib/bloom/BloomEffectComposer.d.ts | 21 ---- lib/bloom/BloomEffectComposer.d.ts.map | 1 - lib/bloom/BloomEffectComposer.js | 37 ------ lib/bloom/MaterialStorage.d.ts | 25 ----- lib/bloom/MaterialStorage.d.ts.map | 1 - lib/bloom/MaterialStorage.js | 89 --------------- lib/bloom/MaterialSwitcher.d.ts | 29 ----- lib/bloom/MaterialSwitcher.d.ts.map | 1 - lib/bloom/MaterialSwitcher.js | 59 ---------- lib/bloom/index.d.ts | 2 - lib/bloom/index.d.ts.map | 1 - lib/bloom/index.js | 17 --- .../ChromaticAberration.frag.glsl.d.ts | 3 - .../ChromaticAberration.frag.glsl.d.ts.map | 1 - .../ChromaticAberration.frag.glsl.js | 25 ----- .../ChromaticAberrationShader.d.ts | 6 - .../ChromaticAberrationShader.d.ts.map | 1 - .../ChromaticAberrationShader.js | 27 ----- .../ChromaticAberrationShaderPass.d.ts | 11 -- .../ChromaticAberrationShaderPass.d.ts.map | 1 - .../ChromaticAberrationShaderPass.js | 29 ----- lib/chromaticAberration/index.d.ts | 2 - lib/chromaticAberration/index.d.ts.map | 1 - lib/chromaticAberration/index.js | 17 --- lib/colorFilter/ColorFilter.frag.glsl.d.ts | 3 - .../ColorFilter.frag.glsl.d.ts.map | 1 - lib/colorFilter/ColorFilter.frag.glsl.js | 56 ---------- lib/colorFilter/ColorFilterShader.d.ts | 6 - lib/colorFilter/ColorFilterShader.d.ts.map | 1 - lib/colorFilter/ColorFilterShader.js | 29 ----- lib/colorFilter/ColorFilterShaderPass.d.ts | 22 ---- .../ColorFilterShaderPass.d.ts.map | 1 - lib/colorFilter/ColorFilterShaderPass.js | 48 -------- lib/colorFilter/index.d.ts | 2 - lib/colorFilter/index.d.ts.map | 1 - lib/colorFilter/index.js | 17 --- .../DisplacementMap.frag.glsl.d.ts | 3 - .../DisplacementMap.frag.glsl.d.ts.map | 1 - lib/displacement/DisplacementMap.frag.glsl.js | 30 ----- lib/displacement/DisplacementMapShader.d.ts | 6 - .../DisplacementMapShader.d.ts.map | 1 - lib/displacement/DisplacementMapShader.js | 30 ----- .../DisplacementMapShaderPass.d.ts | 27 ----- .../DisplacementMapShaderPass.d.ts.map | 1 - lib/displacement/DisplacementMapShaderPass.js | 65 ----------- lib/displacement/index.d.ts | 2 - lib/displacement/index.d.ts.map | 1 - lib/displacement/index.js | 17 --- lib/fxaa/FXAAShaderPass.d.ts | 14 --- lib/fxaa/FXAAShaderPass.d.ts.map | 1 - lib/fxaa/FXAAShaderPass.js | 46 -------- lib/fxaa/index.d.ts | 2 - lib/fxaa/index.d.ts.map | 1 - lib/fxaa/index.js | 17 --- lib/index.d.ts | 10 -- lib/index.d.ts.map | 1 - lib/index.js | 25 ----- lib/mix/MixShader.d.ts | 6 - lib/mix/MixShader.d.ts.map | 1 - lib/mix/MixShader.frag.glsl.d.ts | 3 - lib/mix/MixShader.frag.glsl.d.ts.map | 1 - lib/mix/MixShader.frag.glsl.js | 15 --- lib/mix/MixShader.js | 25 ----- lib/mix/MixShaderPass.d.ts | 11 -- lib/mix/MixShaderPass.d.ts.map | 1 - lib/mix/MixShaderPass.js | 21 ---- lib/mix/index.d.ts | 2 - lib/mix/index.d.ts.map | 1 - lib/mix/index.js | 17 --- lib/monotone/Monotone.frag.glsl.d.ts | 3 - lib/monotone/Monotone.frag.glsl.d.ts.map | 1 - lib/monotone/Monotone.frag.glsl.js | 19 ---- lib/monotone/MonotoneShader.d.ts | 6 - lib/monotone/MonotoneShader.d.ts.map | 1 - lib/monotone/MonotoneShader.js | 26 ----- lib/monotone/MonotoneShaderPass.d.ts | 13 --- lib/monotone/MonotoneShaderPass.d.ts.map | 1 - lib/monotone/MonotoneShaderPass.js | 26 ----- lib/monotone/index.d.ts | 2 - lib/monotone/index.d.ts.map | 1 - lib/monotone/index.js | 17 --- .../PeripheralLight.frag.glsl.d.ts | 3 - .../PeripheralLight.frag.glsl.d.ts.map | 1 - .../PeripheralLight.frag.glsl.js | 24 ---- .../PeripheralLightShader.d.ts | 6 - .../PeripheralLightShader.d.ts.map | 1 - lib/peripheralLight/PeripheralLightShader.js | 28 ----- .../PeripheralLightShaderPass.d.ts | 17 --- .../PeripheralLightShaderPass.d.ts.map | 1 - .../PeripheralLightShaderPass.js | 38 ------- lib/peripheralLight/index.d.ts | 2 - lib/peripheralLight/index.d.ts.map | 1 - lib/peripheralLight/index.js | 17 --- .../PostProcessEffectComposer.d.ts | 10 -- .../PostProcessEffectComposer.d.ts.map | 1 - lib/postprocess/PostProcessEffectComposer.js | 14 --- lib/postprocess/PostProcessRenderer.d.ts | 55 --------- lib/postprocess/PostProcessRenderer.d.ts.map | 1 - lib/postprocess/PostProcessRenderer.js | 105 ------------------ lib/postprocess/PostProcessShader.d.ts | 15 --- lib/postprocess/PostProcessShader.d.ts.map | 1 - lib/postprocess/PostProcessShader.js | 26 ----- lib/postprocess/PostProcessShaderPass.d.ts | 11 -- .../PostProcessShaderPass.d.ts.map | 1 - lib/postprocess/PostProcessShaderPass.js | 13 --- lib/postprocess/index.d.ts | 4 - lib/postprocess/index.d.ts.map | 1 - lib/postprocess/index.js | 19 ---- 109 files changed, 2 insertions(+), 1532 deletions(-) delete mode 100644 lib/bloom/BloomEffectComposer.d.ts delete mode 100644 lib/bloom/BloomEffectComposer.d.ts.map delete mode 100644 lib/bloom/BloomEffectComposer.js delete mode 100644 lib/bloom/MaterialStorage.d.ts delete mode 100644 lib/bloom/MaterialStorage.d.ts.map delete mode 100644 lib/bloom/MaterialStorage.js delete mode 100644 lib/bloom/MaterialSwitcher.d.ts delete mode 100644 lib/bloom/MaterialSwitcher.d.ts.map delete mode 100644 lib/bloom/MaterialSwitcher.js delete mode 100644 lib/bloom/index.d.ts delete mode 100644 lib/bloom/index.d.ts.map delete mode 100644 lib/bloom/index.js delete mode 100644 lib/chromaticAberration/ChromaticAberration.frag.glsl.d.ts delete mode 100644 lib/chromaticAberration/ChromaticAberration.frag.glsl.d.ts.map delete mode 100644 lib/chromaticAberration/ChromaticAberration.frag.glsl.js delete mode 100644 lib/chromaticAberration/ChromaticAberrationShader.d.ts delete mode 100644 lib/chromaticAberration/ChromaticAberrationShader.d.ts.map delete mode 100644 lib/chromaticAberration/ChromaticAberrationShader.js delete mode 100644 lib/chromaticAberration/ChromaticAberrationShaderPass.d.ts delete mode 100644 lib/chromaticAberration/ChromaticAberrationShaderPass.d.ts.map delete mode 100644 lib/chromaticAberration/ChromaticAberrationShaderPass.js delete mode 100644 lib/chromaticAberration/index.d.ts delete mode 100644 lib/chromaticAberration/index.d.ts.map delete mode 100644 lib/chromaticAberration/index.js delete mode 100644 lib/colorFilter/ColorFilter.frag.glsl.d.ts delete mode 100644 lib/colorFilter/ColorFilter.frag.glsl.d.ts.map delete mode 100644 lib/colorFilter/ColorFilter.frag.glsl.js delete mode 100644 lib/colorFilter/ColorFilterShader.d.ts delete mode 100644 lib/colorFilter/ColorFilterShader.d.ts.map delete mode 100644 lib/colorFilter/ColorFilterShader.js delete mode 100644 lib/colorFilter/ColorFilterShaderPass.d.ts delete mode 100644 lib/colorFilter/ColorFilterShaderPass.d.ts.map delete mode 100644 lib/colorFilter/ColorFilterShaderPass.js delete mode 100644 lib/colorFilter/index.d.ts delete mode 100644 lib/colorFilter/index.d.ts.map delete mode 100644 lib/colorFilter/index.js delete mode 100644 lib/displacement/DisplacementMap.frag.glsl.d.ts delete mode 100644 lib/displacement/DisplacementMap.frag.glsl.d.ts.map delete mode 100644 lib/displacement/DisplacementMap.frag.glsl.js delete mode 100644 lib/displacement/DisplacementMapShader.d.ts delete mode 100644 lib/displacement/DisplacementMapShader.d.ts.map delete mode 100644 lib/displacement/DisplacementMapShader.js delete mode 100644 lib/displacement/DisplacementMapShaderPass.d.ts delete mode 100644 lib/displacement/DisplacementMapShaderPass.d.ts.map delete mode 100644 lib/displacement/DisplacementMapShaderPass.js delete mode 100644 lib/displacement/index.d.ts delete mode 100644 lib/displacement/index.d.ts.map delete mode 100644 lib/displacement/index.js delete mode 100644 lib/fxaa/FXAAShaderPass.d.ts delete mode 100644 lib/fxaa/FXAAShaderPass.d.ts.map delete mode 100644 lib/fxaa/FXAAShaderPass.js delete mode 100644 lib/fxaa/index.d.ts delete mode 100644 lib/fxaa/index.d.ts.map delete mode 100644 lib/fxaa/index.js delete mode 100644 lib/index.d.ts delete mode 100644 lib/index.d.ts.map delete mode 100644 lib/index.js delete mode 100644 lib/mix/MixShader.d.ts delete mode 100644 lib/mix/MixShader.d.ts.map delete mode 100644 lib/mix/MixShader.frag.glsl.d.ts delete mode 100644 lib/mix/MixShader.frag.glsl.d.ts.map delete mode 100644 lib/mix/MixShader.frag.glsl.js delete mode 100644 lib/mix/MixShader.js delete mode 100644 lib/mix/MixShaderPass.d.ts delete mode 100644 lib/mix/MixShaderPass.d.ts.map delete mode 100644 lib/mix/MixShaderPass.js delete mode 100644 lib/mix/index.d.ts delete mode 100644 lib/mix/index.d.ts.map delete mode 100644 lib/mix/index.js delete mode 100644 lib/monotone/Monotone.frag.glsl.d.ts delete mode 100644 lib/monotone/Monotone.frag.glsl.d.ts.map delete mode 100644 lib/monotone/Monotone.frag.glsl.js delete mode 100644 lib/monotone/MonotoneShader.d.ts delete mode 100644 lib/monotone/MonotoneShader.d.ts.map delete mode 100644 lib/monotone/MonotoneShader.js delete mode 100644 lib/monotone/MonotoneShaderPass.d.ts delete mode 100644 lib/monotone/MonotoneShaderPass.d.ts.map delete mode 100644 lib/monotone/MonotoneShaderPass.js delete mode 100644 lib/monotone/index.d.ts delete mode 100644 lib/monotone/index.d.ts.map delete mode 100644 lib/monotone/index.js delete mode 100644 lib/peripheralLight/PeripheralLight.frag.glsl.d.ts delete mode 100644 lib/peripheralLight/PeripheralLight.frag.glsl.d.ts.map delete mode 100644 lib/peripheralLight/PeripheralLight.frag.glsl.js delete mode 100644 lib/peripheralLight/PeripheralLightShader.d.ts delete mode 100644 lib/peripheralLight/PeripheralLightShader.d.ts.map delete mode 100644 lib/peripheralLight/PeripheralLightShader.js delete mode 100644 lib/peripheralLight/PeripheralLightShaderPass.d.ts delete mode 100644 lib/peripheralLight/PeripheralLightShaderPass.d.ts.map delete mode 100644 lib/peripheralLight/PeripheralLightShaderPass.js delete mode 100644 lib/peripheralLight/index.d.ts delete mode 100644 lib/peripheralLight/index.d.ts.map delete mode 100644 lib/peripheralLight/index.js delete mode 100644 lib/postprocess/PostProcessEffectComposer.d.ts delete mode 100644 lib/postprocess/PostProcessEffectComposer.d.ts.map delete mode 100644 lib/postprocess/PostProcessEffectComposer.js delete mode 100644 lib/postprocess/PostProcessRenderer.d.ts delete mode 100644 lib/postprocess/PostProcessRenderer.d.ts.map delete mode 100644 lib/postprocess/PostProcessRenderer.js delete mode 100644 lib/postprocess/PostProcessShader.d.ts delete mode 100644 lib/postprocess/PostProcessShader.d.ts.map delete mode 100644 lib/postprocess/PostProcessShader.js delete mode 100644 lib/postprocess/PostProcessShaderPass.d.ts delete mode 100644 lib/postprocess/PostProcessShaderPass.d.ts.map delete mode 100644 lib/postprocess/PostProcessShaderPass.js delete mode 100644 lib/postprocess/index.d.ts delete mode 100644 lib/postprocess/index.d.ts.map delete mode 100644 lib/postprocess/index.js diff --git a/.gitignore b/.gitignore index bacc5e9..e4e48a1 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,5 @@ typings/ .next .idea *.tsbuildinfo -docs \ No newline at end of file +docs +.lib \ No newline at end of file diff --git a/lib/bloom/BloomEffectComposer.d.ts b/lib/bloom/BloomEffectComposer.d.ts deleted file mode 100644 index 435b3ed..0000000 --- a/lib/bloom/BloomEffectComposer.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { WebGLRenderer, Scene, Texture } from "three"; -import { PostProcessEffectComposer } from "../postprocess/PostProcessEffectComposer"; -import { UnrealBloomPass } from "three/examples/jsm/postprocessing/UnrealBloomPass"; -import { RenderPassOption } from "../postprocess"; -import { MaterialSwitcher } from "./MaterialSwitcher"; -/** - * 切り替え可能なUnrealBloomPassを内包したEffectComposer. - * BloomEffectComposer.BLOOMレイヤーに含まれるオブジェクトのみをBloomさせる. - */ -export declare class BloomEffectComposer extends PostProcessEffectComposer { - bloomPass: UnrealBloomPass; - protected switcher: MaterialSwitcher; - static readonly ENTIRE: number; - static readonly BLOOM: number; - constructor(scene: Scene, renderer: WebGLRenderer, renderPassOption: RenderPassOption); - /** - * 描画結果を反映したテクスチャを取得する。 - */ - get result(): Texture; -} -//# sourceMappingURL=BloomEffectComposer.d.ts.map \ No newline at end of file diff --git a/lib/bloom/BloomEffectComposer.d.ts.map b/lib/bloom/BloomEffectComposer.d.ts.map deleted file mode 100644 index 3bc69e9..0000000 --- a/lib/bloom/BloomEffectComposer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"BloomEffectComposer.d.ts","sourceRoot":"","sources":["../../src/bloom/BloomEffectComposer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,yBAAyB;IACzD,SAAS,EAAE,eAAe,CAAC;IAClC,SAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAErC,gBAAuB,MAAM,EAAE,MAAM,CAAK;IAC1C,gBAAuB,KAAK,EAAE,MAAM,CAAM;gBAGxC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,aAAa,EACvB,gBAAgB,EAAE,gBAAgB;IAqBpC;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;CACF"} \ No newline at end of file diff --git a/lib/bloom/BloomEffectComposer.js b/lib/bloom/BloomEffectComposer.js deleted file mode 100644 index 7a20b58..0000000 --- a/lib/bloom/BloomEffectComposer.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BloomEffectComposer = void 0; -const three_1 = require("three"); -const PostProcessEffectComposer_1 = require("../postprocess/PostProcessEffectComposer"); -const UnrealBloomPass_1 = require("three/examples/jsm/postprocessing/UnrealBloomPass"); -const postprocess_1 = require("../postprocess"); -const MaterialSwitcher_1 = require("./MaterialSwitcher"); -/** - * 切り替え可能なUnrealBloomPassを内包したEffectComposer. - * BloomEffectComposer.BLOOMレイヤーに含まれるオブジェクトのみをBloomさせる. - */ -class BloomEffectComposer extends PostProcessEffectComposer_1.PostProcessEffectComposer { - constructor(scene, renderer, renderPassOption) { - super(renderer); - this.switcher = new MaterialSwitcher_1.MaterialSwitcher(scene); - const size = renderer.getSize(new three_1.Vector2()); - this.bloomPass = new UnrealBloomPass_1.UnrealBloomPass(size, 1.5, 0.4, 0.4); - // TODO : PR d.ts - // @ts-ignore - this.renderToScreen = false; - postprocess_1.RenderPassOption.init(renderPassOption); - this.addPass(renderPassOption.renderPass); - this.addPass(this.bloomPass); - this.onBeforeRender = this.switcher.darkenNonBloomed; - this.onAfterRender = this.switcher.restoreMaterial; - } - /** - * 描画結果を反映したテクスチャを取得する。 - */ - get result() { - return this.renderTarget2.texture; - } -} -exports.BloomEffectComposer = BloomEffectComposer; -BloomEffectComposer.ENTIRE = 0; -BloomEffectComposer.BLOOM = 30; diff --git a/lib/bloom/MaterialStorage.d.ts b/lib/bloom/MaterialStorage.d.ts deleted file mode 100644 index 1b95267..0000000 --- a/lib/bloom/MaterialStorage.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Material } from "three"; -/** - * Bloom設定に応じて、オリジナルのマテリアルを格納するためのオブジェクト。 - * Object3D.userData.materialStorageに格納される。 - */ -export declare class MaterialStorage { - original?: Material | Material[]; - dark?: Material | Material[]; - updateMaterial(original: Material | Material[]): void; - private copyMaterialArray; - /** - * darkenマテリアルのコピーに、クローンを使用するかcopyを使用するかを判定する。 - */ - private isClone; - private getHeadMaterial; - private copyToDark; - private cloneToDark; - private darkenMaterialArray; - /** - * マテリアルを反射光のない黒に書き換える。 - * @param material - */ - private static darkenMaterial; -} -//# sourceMappingURL=MaterialStorage.d.ts.map \ No newline at end of file diff --git a/lib/bloom/MaterialStorage.d.ts.map b/lib/bloom/MaterialStorage.d.ts.map deleted file mode 100644 index d78d33a..0000000 --- a/lib/bloom/MaterialStorage.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MaterialStorage.d.ts","sourceRoot":"","sources":["../../src/bloom/MaterialStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC;;;GAGG;AACH,qBAAa,eAAe;IAC1B,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;IACjC,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;IAEtB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAE;IAOrD,OAAO,CAAC,iBAAiB;IAQzB;;OAEG;IACH,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,mBAAmB;IAW3B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;CAc9B"} \ No newline at end of file diff --git a/lib/bloom/MaterialStorage.js b/lib/bloom/MaterialStorage.js deleted file mode 100644 index 671f3fc..0000000 --- a/lib/bloom/MaterialStorage.js +++ /dev/null @@ -1,89 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MaterialStorage = void 0; -/** - * Bloom設定に応じて、オリジナルのマテリアルを格納するためのオブジェクト。 - * Object3D.userData.materialStorageに格納される。 - */ -class MaterialStorage { - updateMaterial(original) { - this.original = original; - this.copyMaterialArray(); - this.darkenMaterialArray(this.dark); - } - copyMaterialArray() { - if (this.isClone()) { - this.cloneToDark(); - } - else { - this.copyToDark(); - } - } - /** - * darkenマテリアルのコピーに、クローンを使用するかcopyを使用するかを判定する。 - */ - isClone() { - const darkenHead = this.getHeadMaterial(this.dark); - const originalHead = this.getHeadMaterial(this.original); - if (darkenHead == null || darkenHead.type !== originalHead.type) { - return true; - } - return false; - } - getHeadMaterial(mat) { - const isArray = Array.isArray(mat); - if (isArray) - return mat[0]; - return mat; - } - copyToDark() { - const isArrayOriginal = Array.isArray(this.original); - if (isArrayOriginal) { - this.dark.forEach((drk, index) => { - drk.copy(this.original[index]); - }); - } - else { - this.dark.copy(this.original); - } - } - cloneToDark() { - const isArrayOriginal = Array.isArray(this.original); - if (isArrayOriginal) { - this.dark = this.original.map(val => { - return val.clone(); - }); - } - else { - this.dark = this.original.clone(); - } - } - darkenMaterialArray(material) { - if (!Array.isArray(material)) { - MaterialStorage.darkenMaterial(material); - return; - } - material.forEach(mat => { - MaterialStorage.darkenMaterial(mat); - }); - } - /** - * マテリアルを反射光のない黒に書き換える。 - * @param material - */ - static darkenMaterial(material) { - if (material["color"] != null) { - material["color"].setHex(0); - } - if (material["shininess"] != null) { - material["shininess"] = 0; - } - if (material["specular"] != null) { - material["specular"].setHex(0); - } - if (material["emissive"] != null) { - material["emissive"].setHex(0); - } - } -} -exports.MaterialStorage = MaterialStorage; diff --git a/lib/bloom/MaterialSwitcher.d.ts b/lib/bloom/MaterialSwitcher.d.ts deleted file mode 100644 index 4f14987..0000000 --- a/lib/bloom/MaterialSwitcher.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Scene, Layers, Object3D } from "three"; -/** - * 切り替え可能なUnrealBloomPassにおいて、マテリアルの切り替え処理を担当するクラス。 - */ -export declare class MaterialSwitcher { - protected scene: Scene; - protected layers: Layers; - constructor(scene: Scene); - darkenNonBloomed: () => void; - restoreMaterial: () => void; - /** - * scene上の各オブジェクトに対して、マテリアルの切り替えを行う。 - * bloom対象外であれば#000のマテリアルに。 - * - * @param obj sceneをtraverseして取得したオブジェクト。 - */ - protected switchToDarken: (obj: Object3D) => void; - /** - * マテリアルストレージに格納されたオリジナルのマテリアル設定に復帰する。 - * @param obj - */ - protected switchToOriginalMaterial: (obj: Object3D) => void; - /** - * そのオブジェクトがbloomマスクの対象か否かを判定する。 - * @param obj - */ - private isDarken; -} -//# sourceMappingURL=MaterialSwitcher.d.ts.map \ No newline at end of file diff --git a/lib/bloom/MaterialSwitcher.d.ts.map b/lib/bloom/MaterialSwitcher.d.ts.map deleted file mode 100644 index fe3f137..0000000 --- a/lib/bloom/MaterialSwitcher.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MaterialSwitcher.d.ts","sourceRoot":"","sources":["../../src/bloom/MaterialSwitcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAQ,MAAM,OAAO,CAAC;AAItD;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACvB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEb,KAAK,EAAE,KAAK;IAMjB,gBAAgB,aAErB;IAEK,eAAe,aAEpB;IAEF;;;;;OAKG;IACH,SAAS,CAAC,cAAc,QAAS,QAAQ,UAWvC;IAEF;;;OAGG;IACH,SAAS,CAAC,wBAAwB,QAAS,QAAQ,UAIjD;IAEF;;;OAGG;IACH,OAAO,CAAC,QAAQ;CAIjB"} \ No newline at end of file diff --git a/lib/bloom/MaterialSwitcher.js b/lib/bloom/MaterialSwitcher.js deleted file mode 100644 index 4416494..0000000 --- a/lib/bloom/MaterialSwitcher.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MaterialSwitcher = void 0; -const three_1 = require("three"); -const BloomEffectComposer_1 = require("./BloomEffectComposer"); -const MaterialStorage_1 = require("./MaterialStorage"); -/** - * 切り替え可能なUnrealBloomPassにおいて、マテリアルの切り替え処理を担当するクラス。 - */ -class MaterialSwitcher { - constructor(scene) { - this.darkenNonBloomed = () => { - this.scene.traverseVisible(this.switchToDarken); - }; - this.restoreMaterial = () => { - this.scene.traverseVisible(this.switchToOriginalMaterial); - }; - /** - * scene上の各オブジェクトに対して、マテリアルの切り替えを行う。 - * bloom対象外であれば#000のマテリアルに。 - * - * @param obj sceneをtraverseして取得したオブジェクト。 - */ - this.switchToDarken = (obj) => { - if (!this.isDarken(obj)) - return; - if (obj.userData.materialStorage == null) { - obj.userData.materialStorage = new MaterialStorage_1.MaterialStorage(); - } - const storage = obj.userData.materialStorage; - const mesh = obj; - storage.updateMaterial(mesh.material); - mesh.material = storage.dark; - }; - /** - * マテリアルストレージに格納されたオリジナルのマテリアル設定に復帰する。 - * @param obj - */ - this.switchToOriginalMaterial = (obj) => { - if (!this.isDarken(obj)) - return; - const mesh = obj; - mesh.material = obj.userData.materialStorage.original; - }; - this.scene = scene; - this.layers = new three_1.Layers(); - this.layers.set(BloomEffectComposer_1.BloomEffectComposer.BLOOM); - } - /** - * そのオブジェクトがbloomマスクの対象か否かを判定する。 - * @param obj - */ - isDarken(obj) { - if (obj.isMesh == null && obj.isLine == null) - return false; - return !this.layers.test(obj.layers); - } -} -exports.MaterialSwitcher = MaterialSwitcher; diff --git a/lib/bloom/index.d.ts b/lib/bloom/index.d.ts deleted file mode 100644 index 58bc97d..0000000 --- a/lib/bloom/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./BloomEffectComposer"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/bloom/index.d.ts.map b/lib/bloom/index.d.ts.map deleted file mode 100644 index b2ddda6..0000000 --- a/lib/bloom/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bloom/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"} \ No newline at end of file diff --git a/lib/bloom/index.js b/lib/bloom/index.js deleted file mode 100644 index de1ae99..0000000 --- a/lib/bloom/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./BloomEffectComposer"), exports); diff --git a/lib/chromaticAberration/ChromaticAberration.frag.glsl.d.ts b/lib/chromaticAberration/ChromaticAberration.frag.glsl.d.ts deleted file mode 100644 index 5bdd304..0000000 --- a/lib/chromaticAberration/ChromaticAberration.frag.glsl.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _default: () => string; -export default _default; -//# sourceMappingURL=ChromaticAberration.frag.glsl.d.ts.map \ No newline at end of file diff --git a/lib/chromaticAberration/ChromaticAberration.frag.glsl.d.ts.map b/lib/chromaticAberration/ChromaticAberration.frag.glsl.d.ts.map deleted file mode 100644 index b1a14bc..0000000 --- a/lib/chromaticAberration/ChromaticAberration.frag.glsl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ChromaticAberration.frag.glsl.d.ts","sourceRoot":"","sources":["../../src/chromaticAberration/ChromaticAberration.frag.glsl.ts"],"names":[],"mappings":";AAAA,wBAsBE"} \ No newline at end of file diff --git a/lib/chromaticAberration/ChromaticAberration.frag.glsl.js b/lib/chromaticAberration/ChromaticAberration.frag.glsl.js deleted file mode 100644 index 1fae737..0000000 --- a/lib/chromaticAberration/ChromaticAberration.frag.glsl.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = () => { - //language=GLSL - return ` -uniform sampler2D tDiffuse; -uniform float rate; -uniform float radiusInner; -uniform float radiusOuter; - -varying vec2 vUv; - -void main() { - float distance = length( vUv - 0.5 )*2.0; - distance = smoothstep( radiusInner, radiusOuter, distance); - float shift = rate * distance * 0.01; - - float r = texture2D( tDiffuse, vUv + vec2( shift, 0.0 ) ).r; - float g = texture2D( tDiffuse, vUv ).g; - float b = texture2D( tDiffuse, vUv - vec2( shift, 0.0 ) ).b; - - gl_FragColor = vec4( vec3(r, g, b) , 1.0 ); -} - `; -}; diff --git a/lib/chromaticAberration/ChromaticAberrationShader.d.ts b/lib/chromaticAberration/ChromaticAberrationShader.d.ts deleted file mode 100644 index c6153ce..0000000 --- a/lib/chromaticAberration/ChromaticAberrationShader.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { PostProcessShader } from "../index"; -export declare class ChromaticAberrationShader extends PostProcessShader { - constructor(); - protected initUniform(): void; -} -//# sourceMappingURL=ChromaticAberrationShader.d.ts.map \ No newline at end of file diff --git a/lib/chromaticAberration/ChromaticAberrationShader.d.ts.map b/lib/chromaticAberration/ChromaticAberrationShader.d.ts.map deleted file mode 100644 index 74d66b7..0000000 --- a/lib/chromaticAberration/ChromaticAberrationShader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ChromaticAberrationShader.d.ts","sourceRoot":"","sources":["../../src/chromaticAberration/ChromaticAberrationShader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,qBAAa,yBAA0B,SAAQ,iBAAiB;;IAM9D,SAAS,CAAC,WAAW;CAWtB"} \ No newline at end of file diff --git a/lib/chromaticAberration/ChromaticAberrationShader.js b/lib/chromaticAberration/ChromaticAberrationShader.js deleted file mode 100644 index 036e26b..0000000 --- a/lib/chromaticAberration/ChromaticAberrationShader.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ChromaticAberrationShader = void 0; -const three_1 = require("three"); -const index_1 = require("../index"); -const ChromaticAberration_frag_glsl_1 = __importDefault(require("./ChromaticAberration.frag.glsl")); -class ChromaticAberrationShader extends index_1.PostProcessShader { - constructor() { - super(); - this.fragmentShader = (0, ChromaticAberration_frag_glsl_1.default)(); - } - initUniform() { - super.initUniform(); - this.uniforms = three_1.UniformsUtils.merge([ - this.uniforms, - { - rate: { value: 1.0 }, - radiusInner: { value: 0.25 }, - radiusOuter: { value: Math.sqrt(2.0) } - } - ]); - } -} -exports.ChromaticAberrationShader = ChromaticAberrationShader; diff --git a/lib/chromaticAberration/ChromaticAberrationShaderPass.d.ts b/lib/chromaticAberration/ChromaticAberrationShaderPass.d.ts deleted file mode 100644 index d5c586f..0000000 --- a/lib/chromaticAberration/ChromaticAberrationShaderPass.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { PostProcessShaderPass } from "../index"; -export declare class ChromaticAberrationShaderPass extends PostProcessShaderPass { - get rate(): number; - set rate(value: number); - get radiusInner(): number; - set radiusInner(value: number); - get radiusOuter(): number; - set radiusOuter(value: number); - constructor(); -} -//# sourceMappingURL=ChromaticAberrationShaderPass.d.ts.map \ No newline at end of file diff --git a/lib/chromaticAberration/ChromaticAberrationShaderPass.d.ts.map b/lib/chromaticAberration/ChromaticAberrationShaderPass.d.ts.map deleted file mode 100644 index 394b41d..0000000 --- a/lib/chromaticAberration/ChromaticAberrationShaderPass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ChromaticAberrationShaderPass.d.ts","sourceRoot":"","sources":["../../src/chromaticAberration/ChromaticAberrationShaderPass.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,qBAAa,6BAA8B,SAAQ,qBAAqB;IACtE,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,EAE5B;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,EAE5B;;CAKF"} \ No newline at end of file diff --git a/lib/chromaticAberration/ChromaticAberrationShaderPass.js b/lib/chromaticAberration/ChromaticAberrationShaderPass.js deleted file mode 100644 index f4db32f..0000000 --- a/lib/chromaticAberration/ChromaticAberrationShaderPass.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ChromaticAberrationShaderPass = void 0; -const ChromaticAberrationShader_1 = require("./ChromaticAberrationShader"); -const index_1 = require("../index"); -class ChromaticAberrationShaderPass extends index_1.PostProcessShaderPass { - get rate() { - return this.uniforms.rate.value; - } - set rate(value) { - this.uniforms.rate.value = value; - } - get radiusInner() { - return this.uniforms.radiusInner.value; - } - set radiusInner(value) { - this.uniforms.radiusInner.value = value; - } - get radiusOuter() { - return this.uniforms.radiusOuter.value; - } - set radiusOuter(value) { - this.uniforms.radiusOuter.value = value; - } - constructor() { - super(new ChromaticAberrationShader_1.ChromaticAberrationShader()); - } -} -exports.ChromaticAberrationShaderPass = ChromaticAberrationShaderPass; diff --git a/lib/chromaticAberration/index.d.ts b/lib/chromaticAberration/index.d.ts deleted file mode 100644 index e2dc37a..0000000 --- a/lib/chromaticAberration/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./ChromaticAberrationShaderPass"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/chromaticAberration/index.d.ts.map b/lib/chromaticAberration/index.d.ts.map deleted file mode 100644 index 4ce2629..0000000 --- a/lib/chromaticAberration/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chromaticAberration/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"} \ No newline at end of file diff --git a/lib/chromaticAberration/index.js b/lib/chromaticAberration/index.js deleted file mode 100644 index 24d3002..0000000 --- a/lib/chromaticAberration/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./ChromaticAberrationShaderPass"), exports); diff --git a/lib/colorFilter/ColorFilter.frag.glsl.d.ts b/lib/colorFilter/ColorFilter.frag.glsl.d.ts deleted file mode 100644 index 15a541f..0000000 --- a/lib/colorFilter/ColorFilter.frag.glsl.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _default: () => string; -export default _default; -//# sourceMappingURL=ColorFilter.frag.glsl.d.ts.map \ No newline at end of file diff --git a/lib/colorFilter/ColorFilter.frag.glsl.d.ts.map b/lib/colorFilter/ColorFilter.frag.glsl.d.ts.map deleted file mode 100644 index f005703..0000000 --- a/lib/colorFilter/ColorFilter.frag.glsl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ColorFilter.frag.glsl.d.ts","sourceRoot":"","sources":["../../src/colorFilter/ColorFilter.frag.glsl.ts"],"names":[],"mappings":";AAAA,wBAqDE"} \ No newline at end of file diff --git a/lib/colorFilter/ColorFilter.frag.glsl.js b/lib/colorFilter/ColorFilter.frag.glsl.js deleted file mode 100644 index be88eb3..0000000 --- a/lib/colorFilter/ColorFilter.frag.glsl.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = () => { - //language=GLSL - return ` -uniform sampler2D tDiffuse; -varying vec2 vUv; - -uniform float h; -uniform float multiS; -uniform float multiB; -uniform float addS; -uniform float addB; - -// Function Patricio Gonzalez Vivo -// https://thebookofshaders.com/06/ -vec3 rgb2hsb( in vec3 c ){ - vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - vec4 p = mix(vec4(c.bg, K.wz), - vec4(c.gb, K.xy), - step(c.b, c.g)); - vec4 q = mix(vec4(p.xyw, c.r), - vec4(c.r, p.yzx), - step(p.x, c.r)); - float d = q.x - min(q.w, q.y); - float e = 1.0e-10; - return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), - d / (q.x + e), - q.x); -} - -// Function from Iñigo Quiles -// https://www.shadertoy.com/view/MsS3Wc -vec3 hsb2rgb( in vec3 c ){ - vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0), - 6.0)-3.0)-1.0, - 0.0, - 1.0 ); - rgb = rgb*rgb*(3.0-2.0*rgb); - return c.z * mix(vec3(1.0), rgb, c.y); -} - -void main() { - vec4 color = texture2D( tDiffuse, vUv ); - vec3 hsb = rgb2hsb(color.rgb); - hsb.x += h; - hsb.y *= multiS; - hsb.z *= multiB; - hsb.y += addS; - hsb.z += addB; - color.rgb = hsb2rgb(hsb); - - gl_FragColor = color; -} - `; -}; diff --git a/lib/colorFilter/ColorFilterShader.d.ts b/lib/colorFilter/ColorFilterShader.d.ts deleted file mode 100644 index 2c90c28..0000000 --- a/lib/colorFilter/ColorFilterShader.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { PostProcessShader } from "../index"; -export declare class ColorFilterShader extends PostProcessShader { - constructor(); - protected initUniform(): void; -} -//# sourceMappingURL=ColorFilterShader.d.ts.map \ No newline at end of file diff --git a/lib/colorFilter/ColorFilterShader.d.ts.map b/lib/colorFilter/ColorFilterShader.d.ts.map deleted file mode 100644 index 9516305..0000000 --- a/lib/colorFilter/ColorFilterShader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ColorFilterShader.d.ts","sourceRoot":"","sources":["../../src/colorFilter/ColorFilterShader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,qBAAa,iBAAkB,SAAQ,iBAAiB;;IAMtD,SAAS,CAAC,WAAW;CAatB"} \ No newline at end of file diff --git a/lib/colorFilter/ColorFilterShader.js b/lib/colorFilter/ColorFilterShader.js deleted file mode 100644 index ee89e80..0000000 --- a/lib/colorFilter/ColorFilterShader.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ColorFilterShader = void 0; -const three_1 = require("three"); -const index_1 = require("../index"); -const ColorFilter_frag_glsl_1 = __importDefault(require("./ColorFilter.frag.glsl")); -class ColorFilterShader extends index_1.PostProcessShader { - constructor() { - super(); - this.fragmentShader = (0, ColorFilter_frag_glsl_1.default)(); - } - initUniform() { - super.initUniform(); - this.uniforms = three_1.UniformsUtils.merge([ - this.uniforms, - { - h: { value: 0.0 }, - multiS: { value: 1.0 }, - multiB: { value: 1.0 }, - addS: { value: 0.0 }, - addB: { value: 0.0 } - } - ]); - } -} -exports.ColorFilterShader = ColorFilterShader; diff --git a/lib/colorFilter/ColorFilterShaderPass.d.ts b/lib/colorFilter/ColorFilterShaderPass.d.ts deleted file mode 100644 index b02258b..0000000 --- a/lib/colorFilter/ColorFilterShaderPass.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { PostProcessShaderPass } from "../index"; -/** - * hsb値をオフセットして、色を変化させるシェーダーパス - * - * 例 ) - * multiS = 0.0, addB = 1.0にすると白に飽和する。 - * multiB = 0.0, もしくはaddB = -1.0 でブラックアウト。 - */ -export declare class ColorFilterShaderPass extends PostProcessShaderPass { - get h(): number; - set h(value: number); - get multiS(): number; - set multiS(value: number); - get multiB(): number; - set multiB(value: number); - get addS(): number; - set addS(value: number); - get addB(): number; - set addB(value: number); - constructor(); -} -//# sourceMappingURL=ColorFilterShaderPass.d.ts.map \ No newline at end of file diff --git a/lib/colorFilter/ColorFilterShaderPass.d.ts.map b/lib/colorFilter/ColorFilterShaderPass.d.ts.map deleted file mode 100644 index cebf29a..0000000 --- a/lib/colorFilter/ColorFilterShaderPass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ColorFilterShaderPass.d.ts","sourceRoot":"","sources":["../../src/colorFilter/ColorFilterShaderPass.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,qBAAqB;IAC9D,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAElB;IACD,IAAI,MAAM,IAAI,MAAM,CAEnB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAEvB;IACD,IAAI,MAAM,IAAI,MAAM,CAEnB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAEvB;IACD,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IACD,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;;CAIF"} \ No newline at end of file diff --git a/lib/colorFilter/ColorFilterShaderPass.js b/lib/colorFilter/ColorFilterShaderPass.js deleted file mode 100644 index fa51720..0000000 --- a/lib/colorFilter/ColorFilterShaderPass.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ColorFilterShaderPass = void 0; -const ColorFilterShader_1 = require("./ColorFilterShader"); -const index_1 = require("../index"); -/** - * hsb値をオフセットして、色を変化させるシェーダーパス - * - * 例 ) - * multiS = 0.0, addB = 1.0にすると白に飽和する。 - * multiB = 0.0, もしくはaddB = -1.0 でブラックアウト。 - */ -class ColorFilterShaderPass extends index_1.PostProcessShaderPass { - get h() { - return this.uniforms.h.value; - } - set h(value) { - this.uniforms.h.value = value; - } - get multiS() { - return this.uniforms.multiS.value; - } - set multiS(value) { - this.uniforms.multiS.value = value; - } - get multiB() { - return this.uniforms.multiB.value; - } - set multiB(value) { - this.uniforms.multiB.value = value; - } - get addS() { - return this.uniforms.addS.value; - } - set addS(value) { - this.uniforms.addS.value = value; - } - get addB() { - return this.uniforms.addB.value; - } - set addB(value) { - this.uniforms.addB.value = value; - } - constructor() { - super(new ColorFilterShader_1.ColorFilterShader()); - } -} -exports.ColorFilterShaderPass = ColorFilterShaderPass; diff --git a/lib/colorFilter/index.d.ts b/lib/colorFilter/index.d.ts deleted file mode 100644 index f251335..0000000 --- a/lib/colorFilter/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./ColorFilterShaderPass"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/colorFilter/index.d.ts.map b/lib/colorFilter/index.d.ts.map deleted file mode 100644 index 7721116..0000000 --- a/lib/colorFilter/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/colorFilter/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"} \ No newline at end of file diff --git a/lib/colorFilter/index.js b/lib/colorFilter/index.js deleted file mode 100644 index ad08eae..0000000 --- a/lib/colorFilter/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./ColorFilterShaderPass"), exports); diff --git a/lib/displacement/DisplacementMap.frag.glsl.d.ts b/lib/displacement/DisplacementMap.frag.glsl.d.ts deleted file mode 100644 index e3aebcc..0000000 --- a/lib/displacement/DisplacementMap.frag.glsl.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _default: () => string; -export default _default; -//# sourceMappingURL=DisplacementMap.frag.glsl.d.ts.map \ No newline at end of file diff --git a/lib/displacement/DisplacementMap.frag.glsl.d.ts.map b/lib/displacement/DisplacementMap.frag.glsl.d.ts.map deleted file mode 100644 index e85a5c7..0000000 --- a/lib/displacement/DisplacementMap.frag.glsl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DisplacementMap.frag.glsl.d.ts","sourceRoot":"","sources":["../../src/displacement/DisplacementMap.frag.glsl.ts"],"names":[],"mappings":";AAAA,wBA2BE"} \ No newline at end of file diff --git a/lib/displacement/DisplacementMap.frag.glsl.js b/lib/displacement/DisplacementMap.frag.glsl.js deleted file mode 100644 index 58374b0..0000000 --- a/lib/displacement/DisplacementMap.frag.glsl.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = () => { - //language=GLSL - return ` -uniform sampler2D tDiffuse; -varying vec2 vUv; - -uniform float strengthX; -uniform float strengthY; -uniform bool hasMap; -uniform sampler2D map; -uniform vec2 aspect; - -void main() { - vec2 uv = vUv; - if( hasMap ){ - vec2 fixedUV = vUv - 0.5; - fixedUV *= aspect; - fixedUV += 0.5; - - vec4 displacement = texture2D( map, fixedUV ); - uv += displacement.rg * vec2 (strengthX, strengthY); - } - - vec4 color = texture2D( tDiffuse, uv ); - gl_FragColor = color; -} - `; -}; diff --git a/lib/displacement/DisplacementMapShader.d.ts b/lib/displacement/DisplacementMapShader.d.ts deleted file mode 100644 index ea5e2a0..0000000 --- a/lib/displacement/DisplacementMapShader.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { PostProcessShader } from "../index"; -export declare class DisplacementMapShader extends PostProcessShader { - constructor(); - protected initUniform(): void; -} -//# sourceMappingURL=DisplacementMapShader.d.ts.map \ No newline at end of file diff --git a/lib/displacement/DisplacementMapShader.d.ts.map b/lib/displacement/DisplacementMapShader.d.ts.map deleted file mode 100644 index 8d9daf8..0000000 --- a/lib/displacement/DisplacementMapShader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DisplacementMapShader.d.ts","sourceRoot":"","sources":["../../src/displacement/DisplacementMapShader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAI7C,qBAAa,qBAAsB,SAAQ,iBAAiB;;IAM1D,SAAS,CAAC,WAAW;CAatB"} \ No newline at end of file diff --git a/lib/displacement/DisplacementMapShader.js b/lib/displacement/DisplacementMapShader.js deleted file mode 100644 index 0edc3dd..0000000 --- a/lib/displacement/DisplacementMapShader.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DisplacementMapShader = void 0; -const three_1 = require("three"); -const index_1 = require("../index"); -const DisplacementMap_frag_glsl_1 = __importDefault(require("./DisplacementMap.frag.glsl")); -const three_2 = require("three"); -class DisplacementMapShader extends index_1.PostProcessShader { - constructor() { - super(); - this.fragmentShader = (0, DisplacementMap_frag_glsl_1.default)(); - } - initUniform() { - super.initUniform(); - this.uniforms = three_1.UniformsUtils.merge([ - this.uniforms, - { - strengthX: { value: 0.0 }, - strengthY: { value: 0.0 }, - map: { value: null }, - hasMap: { value: false }, - aspect: { value: new three_2.Vector2(1.0, 1.0) } - } - ]); - } -} -exports.DisplacementMapShader = DisplacementMapShader; diff --git a/lib/displacement/DisplacementMapShaderPass.d.ts b/lib/displacement/DisplacementMapShaderPass.d.ts deleted file mode 100644 index 6f44984..0000000 --- a/lib/displacement/DisplacementMapShaderPass.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { PostProcessShaderPass } from "../index"; -import { Texture } from "three"; -/** - * DisplacementMapによって画面を歪ませるShaderPass - */ -export declare class DisplacementMapShaderPass extends PostProcessShaderPass { - protected mapSizeW: number; - protected mapSizeH: number; - protected rendererSizeW: number; - protected rendererSizeH: number; - get map(): Texture; - /** - * DisplacementMapを読み込む。 - * 読み込み後にアスペクト比の補正を行う。 - * - * @param url - */ - loadMap(url: string): void; - get strengthX(): number; - set strengthX(value: number); - get strengthY(): number; - set strengthY(value: number); - constructor(); - setSize(width: number, height: number): void; - updateAspect(): void; -} -//# sourceMappingURL=DisplacementMapShaderPass.d.ts.map \ No newline at end of file diff --git a/lib/displacement/DisplacementMapShaderPass.d.ts.map b/lib/displacement/DisplacementMapShaderPass.d.ts.map deleted file mode 100644 index d64910c..0000000 --- a/lib/displacement/DisplacementMapShaderPass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DisplacementMapShaderPass.d.ts","sourceRoot":"","sources":["../../src/displacement/DisplacementMapShaderPass.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,EAAiB,MAAM,OAAO,CAAC;AAG/C;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,qBAAqB;IAClE,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;IAChC,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;IAEhC,IAAI,GAAG,IAAI,OAAO,CAEjB;IAED;;;;;OAKG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM;IAUnB,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,EAE1B;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,EAE1B;;IAMD,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAO5C,YAAY,IAAI,IAAI;CAYrB"} \ No newline at end of file diff --git a/lib/displacement/DisplacementMapShaderPass.js b/lib/displacement/DisplacementMapShaderPass.js deleted file mode 100644 index 221efad..0000000 --- a/lib/displacement/DisplacementMapShaderPass.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DisplacementMapShaderPass = void 0; -const DisplacementMapShader_1 = require("./DisplacementMapShader"); -const index_1 = require("../index"); -const three_1 = require("three"); -const three_2 = require("three"); -/** - * DisplacementMapによって画面を歪ませるShaderPass - */ -class DisplacementMapShaderPass extends index_1.PostProcessShaderPass { - get map() { - return this.uniforms.map.value; - } - /** - * DisplacementMapを読み込む。 - * 読み込み後にアスペクト比の補正を行う。 - * - * @param url - */ - loadMap(url) { - const texture = new three_1.TextureLoader().load(url, texture => { - this.mapSizeW = texture.image.width; - this.mapSizeH = texture.image.height; - this.updateAspect(); - }); - this.uniforms.map.value = texture; - this.uniforms.hasMap.value = texture != null; - } - get strengthX() { - return this.uniforms.strengthX.value; - } - set strengthX(value) { - this.uniforms.strengthX.value = value; - } - get strengthY() { - return this.uniforms.strengthY.value; - } - set strengthY(value) { - this.uniforms.strengthY.value = value; - } - constructor() { - super(new DisplacementMapShader_1.DisplacementMapShader()); - } - setSize(width, height) { - super.setSize(width, height); - this.rendererSizeW = width; - this.rendererSizeH = height; - this.updateAspect(); - } - updateAspect() { - if (this.mapSizeW == null || this.rendererSizeW == null) { - return; - } - const rendererAspect = this.rendererSizeW / this.rendererSizeH; - const mapAspect = this.mapSizeW / this.mapSizeH; - if (rendererAspect > mapAspect) { - this.uniforms.aspect.value = new three_2.Vector2(1.0, mapAspect / rendererAspect); - } - else { - this.uniforms.aspect.value = new three_2.Vector2(rendererAspect / mapAspect, 1.0); - } - } -} -exports.DisplacementMapShaderPass = DisplacementMapShaderPass; diff --git a/lib/displacement/index.d.ts b/lib/displacement/index.d.ts deleted file mode 100644 index 783744c..0000000 --- a/lib/displacement/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./DisplacementMapShaderPass"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/displacement/index.d.ts.map b/lib/displacement/index.d.ts.map deleted file mode 100644 index 49e4a76..0000000 --- a/lib/displacement/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/displacement/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"} \ No newline at end of file diff --git a/lib/displacement/index.js b/lib/displacement/index.js deleted file mode 100644 index 0490724..0000000 --- a/lib/displacement/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./DisplacementMapShaderPass"), exports); diff --git a/lib/fxaa/FXAAShaderPass.d.ts b/lib/fxaa/FXAAShaderPass.d.ts deleted file mode 100644 index e732fda..0000000 --- a/lib/fxaa/FXAAShaderPass.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ShaderMaterial } from "three"; -import { PostProcessShaderPass } from "../postprocess"; -/** - * FXAAShaderを組み込み済みのShaderPass - */ -export declare class FXAAShaderPass extends PostProcessShaderPass { - material: ShaderMaterial; - /** - * コンストラクタ - */ - constructor(); - setSize(width: number, height: number): void; -} -//# sourceMappingURL=FXAAShaderPass.d.ts.map \ No newline at end of file diff --git a/lib/fxaa/FXAAShaderPass.d.ts.map b/lib/fxaa/FXAAShaderPass.d.ts.map deleted file mode 100644 index 898f830..0000000 --- a/lib/fxaa/FXAAShaderPass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"FXAAShaderPass.d.ts","sourceRoot":"","sources":["../../src/fxaa/FXAAShaderPass.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;GAEG;AACH,qBAAa,cAAe,SAAQ,qBAAqB;IACvD,QAAQ,EAAE,cAAc,CAAC;IAEzB;;OAEG;;IAKI,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAMpD"} \ No newline at end of file diff --git a/lib/fxaa/FXAAShaderPass.js b/lib/fxaa/FXAAShaderPass.js deleted file mode 100644 index 925d548..0000000 --- a/lib/fxaa/FXAAShaderPass.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FXAAShaderPass = void 0; -const FXAAShaderModule = __importStar(require("three/examples/jsm/shaders/FXAAShader")); -const postprocess_1 = require("../postprocess"); -/** - * FXAAShaderを組み込み済みのShaderPass - */ -class FXAAShaderPass extends postprocess_1.PostProcessShaderPass { - /** - * コンストラクタ - */ - constructor() { - super(FXAAShaderModule["FXAAShader"]); - } - setSize(width, height) { - super.setSize(width, height); - const uniforms = this.material.uniforms; - uniforms.resolution.value.x = 1 / width; - uniforms.resolution.value.y = 1 / height; - } -} -exports.FXAAShaderPass = FXAAShaderPass; diff --git a/lib/fxaa/index.d.ts b/lib/fxaa/index.d.ts deleted file mode 100644 index b5312ef..0000000 --- a/lib/fxaa/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./FXAAShaderPass"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/fxaa/index.d.ts.map b/lib/fxaa/index.d.ts.map deleted file mode 100644 index cf1e503..0000000 --- a/lib/fxaa/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fxaa/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/lib/fxaa/index.js b/lib/fxaa/index.js deleted file mode 100644 index c218c95..0000000 --- a/lib/fxaa/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./FXAAShaderPass"), exports); diff --git a/lib/index.d.ts b/lib/index.d.ts deleted file mode 100644 index fc41596..0000000 --- a/lib/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from "./postprocess/"; -export * from "./peripheralLight/"; -export * from "./chromaticAberration/"; -export * from "./mix/"; -export * from "./bloom/"; -export * from "./fxaa/"; -export * from "./displacement/"; -export * from "./colorFilter/"; -export * from "./monotone/"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/index.d.ts.map b/lib/index.d.ts.map deleted file mode 100644 index 8a6efcf..0000000 --- a/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index e83b069..0000000 --- a/lib/index.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./postprocess/"), exports); -__exportStar(require("./peripheralLight/"), exports); -__exportStar(require("./chromaticAberration/"), exports); -__exportStar(require("./mix/"), exports); -__exportStar(require("./bloom/"), exports); -__exportStar(require("./fxaa/"), exports); -__exportStar(require("./displacement/"), exports); -__exportStar(require("./colorFilter/"), exports); -__exportStar(require("./monotone/"), exports); diff --git a/lib/mix/MixShader.d.ts b/lib/mix/MixShader.d.ts deleted file mode 100644 index b883bdd..0000000 --- a/lib/mix/MixShader.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { PostProcessShader } from "../index"; -export declare class MixShader extends PostProcessShader { - constructor(); - protected initUniform(): void; -} -//# sourceMappingURL=MixShader.d.ts.map \ No newline at end of file diff --git a/lib/mix/MixShader.d.ts.map b/lib/mix/MixShader.d.ts.map deleted file mode 100644 index 1805a39..0000000 --- a/lib/mix/MixShader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MixShader.d.ts","sourceRoot":"","sources":["../../src/mix/MixShader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAI7C,qBAAa,SAAU,SAAQ,iBAAiB;;IAM9C,SAAS,CAAC,WAAW;CAStB"} \ No newline at end of file diff --git a/lib/mix/MixShader.frag.glsl.d.ts b/lib/mix/MixShader.frag.glsl.d.ts deleted file mode 100644 index 57554fa..0000000 --- a/lib/mix/MixShader.frag.glsl.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _default: () => string; -export default _default; -//# sourceMappingURL=MixShader.frag.glsl.d.ts.map \ No newline at end of file diff --git a/lib/mix/MixShader.frag.glsl.d.ts.map b/lib/mix/MixShader.frag.glsl.d.ts.map deleted file mode 100644 index 2013081..0000000 --- a/lib/mix/MixShader.frag.glsl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MixShader.frag.glsl.d.ts","sourceRoot":"","sources":["../../src/mix/MixShader.frag.glsl.ts"],"names":[],"mappings":";AAAA,wBAYE"} \ No newline at end of file diff --git a/lib/mix/MixShader.frag.glsl.js b/lib/mix/MixShader.frag.glsl.js deleted file mode 100644 index 104de4e..0000000 --- a/lib/mix/MixShader.frag.glsl.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = () => { - //language=GLSL - return ` -uniform sampler2D tDiffuse; -uniform sampler2D mixTexture; -varying vec2 vUv; -vec4 getTexture( sampler2D map ) { - return texture2D( map , vUv ); -} -void main() { - gl_FragColor = ( getTexture( tDiffuse ) + vec4( 1.0 ) * getTexture( mixTexture ) ); -}`; -}; diff --git a/lib/mix/MixShader.js b/lib/mix/MixShader.js deleted file mode 100644 index 7e0f6a3..0000000 --- a/lib/mix/MixShader.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MixShader = void 0; -const index_1 = require("../index"); -const MixShader_frag_glsl_1 = __importDefault(require("./MixShader.frag.glsl")); -const three_1 = require("three"); -class MixShader extends index_1.PostProcessShader { - constructor() { - super(); - this.fragmentShader = (0, MixShader_frag_glsl_1.default)(); - } - initUniform() { - super.initUniform(); - this.uniforms = three_1.UniformsUtils.merge([ - this.uniforms, - { - mixTexture: { value: null } - } - ]); - } -} -exports.MixShader = MixShader; diff --git a/lib/mix/MixShaderPass.d.ts b/lib/mix/MixShaderPass.d.ts deleted file mode 100644 index 63de94a..0000000 --- a/lib/mix/MixShaderPass.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { PostProcessShaderPass } from "../index"; -import { Texture } from "three"; -/** - * 他のエフェクトコンポーザーの描画結果を受け取り、自身のレンダリング結果に乗算するShaderPass - */ -export declare class MixShaderPass extends PostProcessShaderPass { - get mixTexture(): Texture; - set mixTexture(value: Texture); - constructor(mixTexture: Texture); -} -//# sourceMappingURL=MixShaderPass.d.ts.map \ No newline at end of file diff --git a/lib/mix/MixShaderPass.d.ts.map b/lib/mix/MixShaderPass.d.ts.map deleted file mode 100644 index 4063ff9..0000000 --- a/lib/mix/MixShaderPass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MixShaderPass.d.ts","sourceRoot":"","sources":["../../src/mix/MixShaderPass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC;;GAEG;AACH,qBAAa,aAAc,SAAQ,qBAAqB;IACtD,IAAI,UAAU,IAAI,OAAO,CAExB;IACD,IAAI,UAAU,CAAC,KAAK,EAAE,OAAO,EAE5B;gBAEW,UAAU,EAAE,OAAO;CAIhC"} \ No newline at end of file diff --git a/lib/mix/MixShaderPass.js b/lib/mix/MixShaderPass.js deleted file mode 100644 index ccf090a..0000000 --- a/lib/mix/MixShaderPass.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MixShaderPass = void 0; -const index_1 = require("../index"); -const MixShader_1 = require("./MixShader"); -/** - * 他のエフェクトコンポーザーの描画結果を受け取り、自身のレンダリング結果に乗算するShaderPass - */ -class MixShaderPass extends index_1.PostProcessShaderPass { - get mixTexture() { - return this.uniforms.mixTexture.value; - } - set mixTexture(value) { - this.uniforms.mixTexture.value = value; - } - constructor(mixTexture) { - super(new MixShader_1.MixShader()); - this.mixTexture = mixTexture; - } -} -exports.MixShaderPass = MixShaderPass; diff --git a/lib/mix/index.d.ts b/lib/mix/index.d.ts deleted file mode 100644 index 3859407..0000000 --- a/lib/mix/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./MixShaderPass"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/mix/index.d.ts.map b/lib/mix/index.d.ts.map deleted file mode 100644 index 51af158..0000000 --- a/lib/mix/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mix/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib/mix/index.js b/lib/mix/index.js deleted file mode 100644 index 669b2d5..0000000 --- a/lib/mix/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./MixShaderPass"), exports); diff --git a/lib/monotone/Monotone.frag.glsl.d.ts b/lib/monotone/Monotone.frag.glsl.d.ts deleted file mode 100644 index f82c827..0000000 --- a/lib/monotone/Monotone.frag.glsl.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _default: () => string; -export default _default; -//# sourceMappingURL=Monotone.frag.glsl.d.ts.map \ No newline at end of file diff --git a/lib/monotone/Monotone.frag.glsl.d.ts.map b/lib/monotone/Monotone.frag.glsl.d.ts.map deleted file mode 100644 index 5f81fc2..0000000 --- a/lib/monotone/Monotone.frag.glsl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Monotone.frag.glsl.d.ts","sourceRoot":"","sources":["../../src/monotone/Monotone.frag.glsl.ts"],"names":[],"mappings":";AAAA,wBAgBE"} \ No newline at end of file diff --git a/lib/monotone/Monotone.frag.glsl.js b/lib/monotone/Monotone.frag.glsl.js deleted file mode 100644 index f56b578..0000000 --- a/lib/monotone/Monotone.frag.glsl.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = () => { - //language=GLSL - return ` -uniform sampler2D tDiffuse; -varying vec2 vUv; - -uniform float strength; -uniform vec3 color; - -void main() { - vec4 original = texture2D( tDiffuse, vUv ); - vec3 luma = vec3(0.299, 0.587, 0.114); - float v = dot(original.rgb, luma); - gl_FragColor = vec4 (mix( original.rgb, v * color, strength), original.a); -} - `; -}; diff --git a/lib/monotone/MonotoneShader.d.ts b/lib/monotone/MonotoneShader.d.ts deleted file mode 100644 index 4028656..0000000 --- a/lib/monotone/MonotoneShader.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { PostProcessShader } from "../index"; -export declare class MonotoneShader extends PostProcessShader { - constructor(); - protected initUniform(): void; -} -//# sourceMappingURL=MonotoneShader.d.ts.map \ No newline at end of file diff --git a/lib/monotone/MonotoneShader.d.ts.map b/lib/monotone/MonotoneShader.d.ts.map deleted file mode 100644 index ae90ca4..0000000 --- a/lib/monotone/MonotoneShader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MonotoneShader.d.ts","sourceRoot":"","sources":["../../src/monotone/MonotoneShader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,qBAAa,cAAe,SAAQ,iBAAiB;;IAMnD,SAAS,CAAC,WAAW;CAUtB"} \ No newline at end of file diff --git a/lib/monotone/MonotoneShader.js b/lib/monotone/MonotoneShader.js deleted file mode 100644 index a22fddd..0000000 --- a/lib/monotone/MonotoneShader.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MonotoneShader = void 0; -const three_1 = require("three"); -const index_1 = require("../index"); -const Monotone_frag_glsl_1 = __importDefault(require("./Monotone.frag.glsl")); -class MonotoneShader extends index_1.PostProcessShader { - constructor() { - super(); - this.fragmentShader = (0, Monotone_frag_glsl_1.default)(); - } - initUniform() { - super.initUniform(); - this.uniforms = three_1.UniformsUtils.merge([ - this.uniforms, - { - strength: { value: 1.0 }, - color: { value: new three_1.Color(0xffffff) } - } - ]); - } -} -exports.MonotoneShader = MonotoneShader; diff --git a/lib/monotone/MonotoneShaderPass.d.ts b/lib/monotone/MonotoneShaderPass.d.ts deleted file mode 100644 index 604a360..0000000 --- a/lib/monotone/MonotoneShaderPass.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { PostProcessShaderPass } from "../index"; -import { Color } from "three"; -/** - * - */ -export declare class MonotoneShaderPass extends PostProcessShaderPass { - get color(): Color; - set color(value: Color); - get strength(): number; - set strength(value: number); - constructor(); -} -//# sourceMappingURL=MonotoneShaderPass.d.ts.map \ No newline at end of file diff --git a/lib/monotone/MonotoneShaderPass.d.ts.map b/lib/monotone/MonotoneShaderPass.d.ts.map deleted file mode 100644 index 42ac50d..0000000 --- a/lib/monotone/MonotoneShaderPass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MonotoneShaderPass.d.ts","sourceRoot":"","sources":["../../src/monotone/MonotoneShaderPass.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,qBAAqB;IAC3D,IAAI,KAAK,IAAI,KAAK,CAEjB;IACD,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,EAErB;IACD,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEzB;;CAKF"} \ No newline at end of file diff --git a/lib/monotone/MonotoneShaderPass.js b/lib/monotone/MonotoneShaderPass.js deleted file mode 100644 index 084c777..0000000 --- a/lib/monotone/MonotoneShaderPass.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MonotoneShaderPass = void 0; -const MonotoneShader_1 = require("./MonotoneShader"); -const index_1 = require("../index"); -/** - * - */ -class MonotoneShaderPass extends index_1.PostProcessShaderPass { - get color() { - return this.uniforms.color.value; - } - set color(value) { - this.uniforms.color.value = value; - } - get strength() { - return this.uniforms.strength.value; - } - set strength(value) { - this.uniforms.strength.value = value; - } - constructor() { - super(new MonotoneShader_1.MonotoneShader()); - } -} -exports.MonotoneShaderPass = MonotoneShaderPass; diff --git a/lib/monotone/index.d.ts b/lib/monotone/index.d.ts deleted file mode 100644 index 1e434ca..0000000 --- a/lib/monotone/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./MonotoneShaderPass"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/monotone/index.d.ts.map b/lib/monotone/index.d.ts.map deleted file mode 100644 index c44bcae..0000000 --- a/lib/monotone/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/monotone/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/lib/monotone/index.js b/lib/monotone/index.js deleted file mode 100644 index 0a7fdd3..0000000 --- a/lib/monotone/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./MonotoneShaderPass"), exports); diff --git a/lib/peripheralLight/PeripheralLight.frag.glsl.d.ts b/lib/peripheralLight/PeripheralLight.frag.glsl.d.ts deleted file mode 100644 index b8416e5..0000000 --- a/lib/peripheralLight/PeripheralLight.frag.glsl.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _default: () => string; -export default _default; -//# sourceMappingURL=PeripheralLight.frag.glsl.d.ts.map \ No newline at end of file diff --git a/lib/peripheralLight/PeripheralLight.frag.glsl.d.ts.map b/lib/peripheralLight/PeripheralLight.frag.glsl.d.ts.map deleted file mode 100644 index 5ccaf11..0000000 --- a/lib/peripheralLight/PeripheralLight.frag.glsl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PeripheralLight.frag.glsl.d.ts","sourceRoot":"","sources":["../../src/peripheralLight/PeripheralLight.frag.glsl.ts"],"names":[],"mappings":";AAAA,wBAqBE"} \ No newline at end of file diff --git a/lib/peripheralLight/PeripheralLight.frag.glsl.js b/lib/peripheralLight/PeripheralLight.frag.glsl.js deleted file mode 100644 index 70937f7..0000000 --- a/lib/peripheralLight/PeripheralLight.frag.glsl.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = () => { - //language=GLSL - return ` -uniform sampler2D tDiffuse; -uniform float rate; -uniform float radiusInner; -uniform float radiusOuter; -uniform vec3 color; -varying vec2 vUv; - -void main() { - float distance = length( vUv - 0.5 )*2.0; - distance = smoothstep( radiusInner, radiusOuter, distance); - float shift = rate * distance * 0.01; - - vec4 original = texture2D( tDiffuse, vUv ); - vec3 result = mix( original.rgb, color, shift); - - gl_FragColor = vec4( result , original.a ); -} - `; -}; diff --git a/lib/peripheralLight/PeripheralLightShader.d.ts b/lib/peripheralLight/PeripheralLightShader.d.ts deleted file mode 100644 index 97be4ba..0000000 --- a/lib/peripheralLight/PeripheralLightShader.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { PostProcessShader } from "../index"; -export declare class PeripheralLightShader extends PostProcessShader { - constructor(); - protected initUniform(): void; -} -//# sourceMappingURL=PeripheralLightShader.d.ts.map \ No newline at end of file diff --git a/lib/peripheralLight/PeripheralLightShader.d.ts.map b/lib/peripheralLight/PeripheralLightShader.d.ts.map deleted file mode 100644 index 619fe69..0000000 --- a/lib/peripheralLight/PeripheralLightShader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PeripheralLightShader.d.ts","sourceRoot":"","sources":["../../src/peripheralLight/PeripheralLightShader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,qBAAa,qBAAsB,SAAQ,iBAAiB;;IAM1D,SAAS,CAAC,WAAW;CAYtB"} \ No newline at end of file diff --git a/lib/peripheralLight/PeripheralLightShader.js b/lib/peripheralLight/PeripheralLightShader.js deleted file mode 100644 index 3e2364a..0000000 --- a/lib/peripheralLight/PeripheralLightShader.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PeripheralLightShader = void 0; -const three_1 = require("three"); -const index_1 = require("../index"); -const PeripheralLight_frag_glsl_1 = __importDefault(require("./PeripheralLight.frag.glsl")); -class PeripheralLightShader extends index_1.PostProcessShader { - constructor() { - super(); - this.fragmentShader = (0, PeripheralLight_frag_glsl_1.default)(); - } - initUniform() { - super.initUniform(); - this.uniforms = three_1.UniformsUtils.merge([ - this.uniforms, - { - rate: { value: 5.0 }, - radiusInner: { value: 0.75 }, - radiusOuter: { value: Math.sqrt(2.0) }, - color: { value: new three_1.Color(0, 0, 0) } - } - ]); - } -} -exports.PeripheralLightShader = PeripheralLightShader; diff --git a/lib/peripheralLight/PeripheralLightShaderPass.d.ts b/lib/peripheralLight/PeripheralLightShaderPass.d.ts deleted file mode 100644 index 23b896f..0000000 --- a/lib/peripheralLight/PeripheralLightShaderPass.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Color } from "three"; -import { PostProcessShaderPass } from "../index"; -/** - * 周辺光量の減光を表現するフィルタ。 - */ -export declare class PeripheralLightShaderPass extends PostProcessShaderPass { - get rate(): number; - set rate(value: number); - get radiusInner(): number; - set radiusInner(value: number); - get radiusOuter(): number; - set radiusOuter(value: number); - get color(): Color; - set color(value: Color); - constructor(); -} -//# sourceMappingURL=PeripheralLightShaderPass.d.ts.map \ No newline at end of file diff --git a/lib/peripheralLight/PeripheralLightShaderPass.d.ts.map b/lib/peripheralLight/PeripheralLightShaderPass.d.ts.map deleted file mode 100644 index f53f2cf..0000000 --- a/lib/peripheralLight/PeripheralLightShaderPass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PeripheralLightShaderPass.d.ts","sourceRoot":"","sources":["../../src/peripheralLight/PeripheralLightShaderPass.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,qBAAqB;IAClE,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,EAE5B;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,EAE5B;IAED,IAAI,KAAK,IAAI,KAAK,CAEjB;IACD,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,EAErB;;CAKF"} \ No newline at end of file diff --git a/lib/peripheralLight/PeripheralLightShaderPass.js b/lib/peripheralLight/PeripheralLightShaderPass.js deleted file mode 100644 index 3d14953..0000000 --- a/lib/peripheralLight/PeripheralLightShaderPass.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PeripheralLightShaderPass = void 0; -const PeripheralLightShader_1 = require("./PeripheralLightShader"); -const index_1 = require("../index"); -/** - * 周辺光量の減光を表現するフィルタ。 - */ -class PeripheralLightShaderPass extends index_1.PostProcessShaderPass { - get rate() { - return this.uniforms.rate.value; - } - set rate(value) { - this.uniforms.rate.value = value; - } - get radiusInner() { - return this.uniforms.radiusInner.value; - } - set radiusInner(value) { - this.uniforms.radiusInner.value = value; - } - get radiusOuter() { - return this.uniforms.radiusOuter.value; - } - set radiusOuter(value) { - this.uniforms.radiusOuter.value = value; - } - get color() { - return this.uniforms.color.value; - } - set color(value) { - this.uniforms.color.value = value; - } - constructor() { - super(new PeripheralLightShader_1.PeripheralLightShader()); - } -} -exports.PeripheralLightShaderPass = PeripheralLightShaderPass; diff --git a/lib/peripheralLight/index.d.ts b/lib/peripheralLight/index.d.ts deleted file mode 100644 index d6a0680..0000000 --- a/lib/peripheralLight/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./PeripheralLightShaderPass"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/peripheralLight/index.d.ts.map b/lib/peripheralLight/index.d.ts.map deleted file mode 100644 index b67529e..0000000 --- a/lib/peripheralLight/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/peripheralLight/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"} \ No newline at end of file diff --git a/lib/peripheralLight/index.js b/lib/peripheralLight/index.js deleted file mode 100644 index ba885c7..0000000 --- a/lib/peripheralLight/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./PeripheralLightShaderPass"), exports); diff --git a/lib/postprocess/PostProcessEffectComposer.d.ts b/lib/postprocess/PostProcessEffectComposer.d.ts deleted file mode 100644 index 80653de..0000000 --- a/lib/postprocess/PostProcessEffectComposer.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer"; -/** - * レンダリングの前後に任意の処理を実行する機能を追加したEffectComposer. - */ -export declare class PostProcessEffectComposer extends EffectComposer { - enabled: boolean; - onBeforeRender?: (delta?: number) => void; - onAfterRender?: (delta?: number) => void; -} -//# sourceMappingURL=PostProcessEffectComposer.d.ts.map \ No newline at end of file diff --git a/lib/postprocess/PostProcessEffectComposer.d.ts.map b/lib/postprocess/PostProcessEffectComposer.d.ts.map deleted file mode 100644 index b61a75f..0000000 --- a/lib/postprocess/PostProcessEffectComposer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PostProcessEffectComposer.d.ts","sourceRoot":"","sources":["../../src/postprocess/PostProcessEffectComposer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAElF;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,cAAc;IAC3D,OAAO,EAAE,OAAO,CAAQ;IACjB,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD"} \ No newline at end of file diff --git a/lib/postprocess/PostProcessEffectComposer.js b/lib/postprocess/PostProcessEffectComposer.js deleted file mode 100644 index 1db46c8..0000000 --- a/lib/postprocess/PostProcessEffectComposer.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PostProcessEffectComposer = void 0; -const EffectComposer_1 = require("three/examples/jsm/postprocessing/EffectComposer"); -/** - * レンダリングの前後に任意の処理を実行する機能を追加したEffectComposer. - */ -class PostProcessEffectComposer extends EffectComposer_1.EffectComposer { - constructor() { - super(...arguments); - this.enabled = true; - } -} -exports.PostProcessEffectComposer = PostProcessEffectComposer; diff --git a/lib/postprocess/PostProcessRenderer.d.ts b/lib/postprocess/PostProcessRenderer.d.ts deleted file mode 100644 index 1d893e7..0000000 --- a/lib/postprocess/PostProcessRenderer.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { WebGLRenderer, Scene, PerspectiveCamera, Vector2, Camera } from "three"; -import { RenderPass } from "three/examples/jsm/postprocessing/RenderPass"; -import { Pass } from "three/examples/jsm/postprocessing/Pass"; -import { PostProcessEffectComposer } from "./PostProcessEffectComposer"; -import { RAFTickerEventContext } from "@masatomakino/raf-ticker"; -/** - * 複数のエフェクトコンポーザーと、WebGLRendererを管理し、 - * 連続してポストエフェクト処理を行うためのクラス。 - */ -export declare class PostProcessRenderer { - get composers(): PostProcessEffectComposer[]; - protected renderer: WebGLRenderer; - private _composers; - protected scene: Scene; - protected camera: PerspectiveCamera; - constructor(scene: Scene, camera: PerspectiveCamera, renderer: WebGLRenderer); - /** - * シェーダーパスを挟んだEffectComposerを生成、登録する。 - * @param passes - * @param renderPass - */ - addComposer(passes: Pass[], renderPass?: RenderPass): PostProcessEffectComposer; - /** - * コンポーザーを生成する。 - * @param passes - * @param renderer - * @param renderPassOption - */ - static getComposer(passes: Pass[], renderer: WebGLRenderer, renderPassOption: RenderPassOption): PostProcessEffectComposer; - /** - * ウィンドウリサイズ時の処理 - * @param w - * @param h - */ - setSize(w: number, h: number): void; - /** - * WebGLRendererのレンダリングサイズを取得する。 - */ - getSize(): Vector2; - render: (arg: RAFTickerEventContext | number) => void; -} -/** - * getComposer関数で利用するRenderPass初期化オプション - * - * sceneとcameraのセット、もしくはrenderPassインスタンスを代入する必要がある。 - * sceneとcameraのセットの場合 : RenderPassインスタンスを生成する。 - * renderPassインスタンスの場合 : そのままrenderPassインスタンスを利用する。 - */ -export declare class RenderPassOption { - scene?: Scene; - camera?: Camera; - renderPass?: RenderPass; - static init(option: RenderPassOption): void; -} -//# sourceMappingURL=PostProcessRenderer.d.ts.map \ No newline at end of file diff --git a/lib/postprocess/PostProcessRenderer.d.ts.map b/lib/postprocess/PostProcessRenderer.d.ts.map deleted file mode 100644 index d53de2f..0000000 --- a/lib/postprocess/PostProcessRenderer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PostProcessRenderer.d.ts","sourceRoot":"","sources":["../../src/postprocess/PostProcessRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,EACL,iBAAiB,EACjB,OAAO,EACP,MAAM,EACP,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,wCAAwC,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,IAAI,SAAS,IAAI,yBAAyB,EAAE,CAE3C;IAED,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC;IAClC,OAAO,CAAC,UAAU,CAAmC;IACrD,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACvB,SAAS,CAAC,MAAM,EAAE,iBAAiB,CAAC;gBAGlC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,aAAa;IAOzB;;;;OAIG;IACI,WAAW,CAChB,MAAM,EAAE,IAAI,EAAE,EACd,UAAU,CAAC,EAAE,UAAU,GACtB,yBAAyB;IAW5B;;;;;OAKG;WACW,WAAW,CACvB,MAAM,EAAE,IAAI,EAAE,EACd,QAAQ,EAAE,aAAa,EACvB,gBAAgB,EAAE,gBAAgB,GACjC,yBAAyB;IAU5B;;;;OAIG;IACI,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAW1C;;OAEG;IACI,OAAO,IAAI,OAAO;IAIlB,MAAM,QAAS,qBAAqB,GAAG,MAAM,UAelD;CACH;AAED;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;WAEV,IAAI,CAAC,MAAM,EAAE,gBAAgB;CAK5C"} \ No newline at end of file diff --git a/lib/postprocess/PostProcessRenderer.js b/lib/postprocess/PostProcessRenderer.js deleted file mode 100644 index 5621ab1..0000000 --- a/lib/postprocess/PostProcessRenderer.js +++ /dev/null @@ -1,105 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.RenderPassOption = exports.PostProcessRenderer = void 0; -const three_1 = require("three"); -const RenderPass_1 = require("three/examples/jsm/postprocessing/RenderPass"); -const PostProcessEffectComposer_1 = require("./PostProcessEffectComposer"); -const raf_ticker_1 = require("@masatomakino/raf-ticker"); -/** - * 複数のエフェクトコンポーザーと、WebGLRendererを管理し、 - * 連続してポストエフェクト処理を行うためのクラス。 - */ -class PostProcessRenderer { - get composers() { - return this._composers; - } - constructor(scene, camera, renderer) { - this._composers = []; - this.render = (arg) => { - let delta; - if (arg instanceof raf_ticker_1.RAFTickerEventContext) { - delta = arg.delta; - } - else { - delta = arg; - } - this._composers.forEach((composer) => { - if (!composer.enabled) - return; - if (composer.onBeforeRender) - composer.onBeforeRender(delta); - composer.render(delta); - if (composer.onAfterRender) - composer.onAfterRender(delta); - }); - }; - this.renderer = renderer; - this.scene = scene; - this.camera = camera; - } - /** - * シェーダーパスを挟んだEffectComposerを生成、登録する。 - * @param passes - * @param renderPass - */ - addComposer(passes, renderPass) { - const composer = PostProcessRenderer.getComposer(passes, this.renderer, { - scene: this.scene, - camera: this.camera, - renderPass: renderPass, - }); - this._composers.push(composer); - return composer; - } - /** - * コンポーザーを生成する。 - * @param passes - * @param renderer - * @param renderPassOption - */ - static getComposer(passes, renderer, renderPassOption) { - RenderPassOption.init(renderPassOption); - const composer = new PostProcessEffectComposer_1.PostProcessEffectComposer(renderer); - composer.addPass(renderPassOption.renderPass); - passes.forEach((p) => { - composer.addPass(p); - }); - return composer; - } - /** - * ウィンドウリサイズ時の処理 - * @param w - * @param h - */ - setSize(w, h) { - this.camera.aspect = w / h; - this.camera.updateProjectionMatrix(); - this.renderer.setPixelRatio(window.devicePixelRatio); - this.renderer.setSize(w, h); - this._composers.forEach((composer) => { - composer.setSize(w, h); - }); - } - /** - * WebGLRendererのレンダリングサイズを取得する。 - */ - getSize() { - return this.renderer.getSize(new three_1.Vector2()); - } -} -exports.PostProcessRenderer = PostProcessRenderer; -/** - * getComposer関数で利用するRenderPass初期化オプション - * - * sceneとcameraのセット、もしくはrenderPassインスタンスを代入する必要がある。 - * sceneとcameraのセットの場合 : RenderPassインスタンスを生成する。 - * renderPassインスタンスの場合 : そのままrenderPassインスタンスを利用する。 - */ -class RenderPassOption { - static init(option) { - if (option.renderPass == null) { - option.renderPass = new RenderPass_1.RenderPass(option.scene, option.camera); - } - } -} -exports.RenderPassOption = RenderPassOption; diff --git a/lib/postprocess/PostProcessShader.d.ts b/lib/postprocess/PostProcessShader.d.ts deleted file mode 100644 index 8f1e8ca..0000000 --- a/lib/postprocess/PostProcessShader.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { IUniform } from "three"; -/** - * EffectComposer用のShaderオブジェクトに必要な要素を定義したクラス。 - * このクラスのインスタンスをShaderPassに渡すことで、任意のシェーダーエフェクトコンポーザーになる。 - */ -export declare class PostProcessShader { - uniforms: { - [uniform: string]: IUniform; - }; - vertexShader: string; - fragmentShader: string; - constructor(); - protected initUniform(): void; -} -//# sourceMappingURL=PostProcessShader.d.ts.map \ No newline at end of file diff --git a/lib/postprocess/PostProcessShader.d.ts.map b/lib/postprocess/PostProcessShader.d.ts.map deleted file mode 100644 index 38ea026..0000000 --- a/lib/postprocess/PostProcessShader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PostProcessShader.d.ts","sourceRoot":"","sources":["../../src/postprocess/PostProcessShader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,QAAQ,EAAE;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAC;IAE1C,YAAY,EAAE,MAAM,CAMlB;IACF,cAAc,EAAE,MAAM,CAAC;;IAKvB,SAAS,CAAC,WAAW;CAKtB"} \ No newline at end of file diff --git a/lib/postprocess/PostProcessShader.js b/lib/postprocess/PostProcessShader.js deleted file mode 100644 index ef63675..0000000 --- a/lib/postprocess/PostProcessShader.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PostProcessShader = void 0; -/** - * EffectComposer用のShaderオブジェクトに必要な要素を定義したクラス。 - * このクラスのインスタンスをShaderPassに渡すことで、任意のシェーダーエフェクトコンポーザーになる。 - */ -class PostProcessShader { - constructor() { - //language=GLSL - this.vertexShader = ` - varying vec2 vUv; - void main() { - vUv = uv; - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - } - `; - this.initUniform(); - } - initUniform() { - this.uniforms = { - tDiffuse: { value: null } - }; - } -} -exports.PostProcessShader = PostProcessShader; diff --git a/lib/postprocess/PostProcessShaderPass.d.ts b/lib/postprocess/PostProcessShaderPass.d.ts deleted file mode 100644 index 84fa9e0..0000000 --- a/lib/postprocess/PostProcessShaderPass.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { IUniform } from "three"; -import { ShaderPass } from "three/examples/jsm/postprocessing/ShaderPass"; -import { Texture } from "three"; -export declare class PostProcessShaderPass extends ShaderPass { - uniforms: { - [uniform: string]: IUniform; - }; - get tDiffuse(): Texture; - set tDiffuse(value: Texture); -} -//# sourceMappingURL=PostProcessShaderPass.d.ts.map \ No newline at end of file diff --git a/lib/postprocess/PostProcessShaderPass.d.ts.map b/lib/postprocess/PostProcessShaderPass.d.ts.map deleted file mode 100644 index b27c7ad..0000000 --- a/lib/postprocess/PostProcessShaderPass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PostProcessShaderPass.d.ts","sourceRoot":"","sources":["../../src/postprocess/PostProcessShaderPass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,qBAAa,qBAAsB,SAAQ,UAAU;IACnD,QAAQ,EAAE;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAC;IAE1C,IAAI,QAAQ,IAAI,OAAO,CAEtB;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAE1B;CACF"} \ No newline at end of file diff --git a/lib/postprocess/PostProcessShaderPass.js b/lib/postprocess/PostProcessShaderPass.js deleted file mode 100644 index 6ee79dc..0000000 --- a/lib/postprocess/PostProcessShaderPass.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PostProcessShaderPass = void 0; -const ShaderPass_1 = require("three/examples/jsm/postprocessing/ShaderPass"); -class PostProcessShaderPass extends ShaderPass_1.ShaderPass { - get tDiffuse() { - return this.uniforms.tDiffuse.value; - } - set tDiffuse(value) { - this.uniforms.tDiffuse.value = value; - } -} -exports.PostProcessShaderPass = PostProcessShaderPass; diff --git a/lib/postprocess/index.d.ts b/lib/postprocess/index.d.ts deleted file mode 100644 index 81a1ce4..0000000 --- a/lib/postprocess/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./PostProcessRenderer"; -export * from "./PostProcessShader"; -export * from "./PostProcessShaderPass"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/postprocess/index.d.ts.map b/lib/postprocess/index.d.ts.map deleted file mode 100644 index 09c193e..0000000 --- a/lib/postprocess/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/postprocess/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"} \ No newline at end of file diff --git a/lib/postprocess/index.js b/lib/postprocess/index.js deleted file mode 100644 index 050ee12..0000000 --- a/lib/postprocess/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./PostProcessRenderer"), exports); -__exportStar(require("./PostProcessShader"), exports); -__exportStar(require("./PostProcessShaderPass"), exports); From f23181f22782141fb3ff902bc3b8b175907197c8 Mon Sep 17 00:00:00 2001 From: MasatoMakino Date: Sun, 28 Jan 2024 17:20:17 +0900 Subject: [PATCH 3/3] fix : import path --- demoSrc/Common.js | 2 +- demoSrc/demoAA.js | 12 ++++++++---- demoSrc/demoBloom.js | 12 ++++++++---- demoSrc/demoChromaticAberration.js | 8 +++++--- demoSrc/demoColorFilter.js | 8 ++++---- demoSrc/demoDisplacement.js | 11 +++++++---- demoSrc/demoMonotone.js | 8 ++++---- demoSrc/demoPeripheralLight.js | 9 ++++++--- 8 files changed, 43 insertions(+), 27 deletions(-) diff --git a/demoSrc/Common.js b/demoSrc/Common.js index 4b81560..47dde79 100644 --- a/demoSrc/Common.js +++ b/demoSrc/Common.js @@ -6,7 +6,7 @@ import { Scene, WebGLRenderer, } from "three"; -import { OrbitControls } from "three/examples/jsm/controls/OrbitControls"; +import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js"; export class Common { static initScene() { diff --git a/demoSrc/demoAA.js b/demoSrc/demoAA.js index 14236b9..248a970 100644 --- a/demoSrc/demoAA.js +++ b/demoSrc/demoAA.js @@ -8,11 +8,15 @@ import { SphereGeometry, Vector2, } from "three"; -import { Common } from "./Common"; -import { BloomEffectComposer, FXAAShaderPass, PostProcessRenderer } from ".."; +import { Common } from "./Common.js"; +import { + BloomEffectComposer, + FXAAShaderPass, + PostProcessRenderer, +} from "../esm/index.js"; import GUI from "lil-gui"; -import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass"; -import { CommonGUI } from "./CommonGUI"; +import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass.js"; +import { CommonGUI } from "./CommonGUI.js"; import { RAFTicker } from "@masatomakino/raf-ticker"; export class StudyBloom { diff --git a/demoSrc/demoBloom.js b/demoSrc/demoBloom.js index c4acfef..9146f4e 100644 --- a/demoSrc/demoBloom.js +++ b/demoSrc/demoBloom.js @@ -7,11 +7,15 @@ import { PointLightHelper, SphereGeometry, } from "three"; -import { Common } from "./Common"; -import { BloomEffectComposer, MixShaderPass, PostProcessRenderer } from ".."; +import { Common } from "./Common.js"; +import { + BloomEffectComposer, + MixShaderPass, + PostProcessRenderer, +} from "../esm/index.js"; import GUI from "lil-gui"; -import { RenderPass } from "three/examples/jsm/postprocessing/RenderPass"; -import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass"; +import { RenderPass } from "three/examples/jsm/postprocessing/RenderPass.js"; +import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass.js"; import { RAFTicker } from "@masatomakino/raf-ticker"; export class StudyBloom { diff --git a/demoSrc/demoChromaticAberration.js b/demoSrc/demoChromaticAberration.js index 7166b39..5bafb0f 100644 --- a/demoSrc/demoChromaticAberration.js +++ b/demoSrc/demoChromaticAberration.js @@ -1,15 +1,17 @@ import { Color, - Fog, Mesh, MeshLambertMaterial, PointLight, PointLightHelper, SphereGeometry, } from "three"; -import { Common } from "./Common"; +import { Common } from "./Common.js"; import GUI from "lil-gui"; -import { ChromaticAberrationShaderPass, PostProcessRenderer } from ".."; +import { + ChromaticAberrationShaderPass, + PostProcessRenderer, +} from "../esm/index.js"; import { RAFTicker } from "@masatomakino/raf-ticker"; export class Study { diff --git a/demoSrc/demoColorFilter.js b/demoSrc/demoColorFilter.js index ecd041f..36a010e 100644 --- a/demoSrc/demoColorFilter.js +++ b/demoSrc/demoColorFilter.js @@ -1,9 +1,9 @@ import { Color, Mesh, MeshLambertMaterial, SphereGeometry } from "three"; -import { Common } from "./Common"; +import { Common } from "./Common.js"; import GUI from "lil-gui"; -import { ColorFilterShaderPass, PostProcessRenderer } from ".."; -import { CommonGUI } from "./CommonGUI"; -import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass"; +import { ColorFilterShaderPass, PostProcessRenderer } from "../esm/index.js"; +import { CommonGUI } from "./CommonGUI.js"; +import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass.js"; import { RAFTicker } from "@masatomakino/raf-ticker"; class Study { diff --git a/demoSrc/demoDisplacement.js b/demoSrc/demoDisplacement.js index dd08975..05d1829 100644 --- a/demoSrc/demoDisplacement.js +++ b/demoSrc/demoDisplacement.js @@ -1,9 +1,12 @@ import { Color, Fog, Mesh, MeshLambertMaterial, SphereGeometry } from "three"; -import { Common } from "./Common"; +import { Common } from "./Common.js"; import GUI from "lil-gui"; -import { DisplacementMapShaderPass, PostProcessRenderer } from ".."; -import { CommonGUI } from "./CommonGUI"; -import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass"; +import { + DisplacementMapShaderPass, + PostProcessRenderer, +} from "../esm/index.js"; +import { CommonGUI } from "./CommonGUI.js"; +import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass.js"; import { RAFTicker, RAFTickerEventType } from "@masatomakino/raf-ticker"; class Study { diff --git a/demoSrc/demoMonotone.js b/demoSrc/demoMonotone.js index 42707d8..5145353 100644 --- a/demoSrc/demoMonotone.js +++ b/demoSrc/demoMonotone.js @@ -1,9 +1,9 @@ import { Color, Mesh, MeshLambertMaterial, SphereGeometry } from "three"; -import { Common } from "./Common"; +import { Common } from "./Common.js"; import GUI from "lil-gui"; -import { MonotoneShaderPass, PostProcessRenderer } from ".."; -import { CommonGUI } from "./CommonGUI"; -import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass"; +import { MonotoneShaderPass, PostProcessRenderer } from "../esm/index.js"; +import { CommonGUI } from "./CommonGUI.js"; +import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass.js"; import { RAFTicker, RAFTickerEventType } from "@masatomakino/raf-ticker"; class Study { diff --git a/demoSrc/demoPeripheralLight.js b/demoSrc/demoPeripheralLight.js index 816d26b..3eed11d 100644 --- a/demoSrc/demoPeripheralLight.js +++ b/demoSrc/demoPeripheralLight.js @@ -1,8 +1,11 @@ import { Color, Fog, Mesh, MeshLambertMaterial, SphereGeometry } from "three"; -import { Common } from "./Common"; +import { Common } from "./Common.js"; import GUI from "lil-gui"; -import { PeripheralLightShaderPass, PostProcessRenderer } from ".."; -import { RAFTicker, RAFTickerEventType } from "@masatomakino/raf-ticker"; +import { + PeripheralLightShaderPass, + PostProcessRenderer, +} from "../esm/index.js"; +import { RAFTicker } from "@masatomakino/raf-ticker"; class Study { constructor() {