From 3a2ec97e04fdf4523865092ef63b0d8935574266 Mon Sep 17 00:00:00 2001 From: Alvaro Saburido Date: Fri, 3 Jan 2025 10:37:18 +0100 Subject: [PATCH] fix!: unified-exports-suffix-pmndrs-effects (#154) * fix!: restructure post-processing module and update playground examples BREAKING CHANGE: Consolidated post-processing effects under a unified namespace (`@tresjs/post-processing`). Pmndrs `EffectComposer` is now `EffectComposerPmndrs`, same for all the effects and composables under `src/core/pmndrs` to avoid name collisions * chore: remove nuxt playground * docs: updated docs to breaking changes * chore: update deps and tsconfig for docs * fix: adjusted aliases in vite config --------- Co-authored-by: Tino Koch <17991193+Tinoooo@users.noreply.github.com> --- docs/.vitepress/config.ts | 3 +- .../theme/components/pmdrs/BloomDemo.vue | 8 +- .../components/pmdrs/DepthOfFieldDemo.vue | 9 +- .../theme/components/pmdrs/GlitchDemo.vue | 8 +- .../theme/components/pmdrs/NoiseDemo.vue | 8 +- .../theme/components/pmdrs/OutlineDemo.vue | 9 +- .../theme/components/pmdrs/PixelationDemo.vue | 8 +- .../theme/components/pmdrs/VignetteDemo.vue | 10 +- .../components/three/GlitchThreeDemo.vue | 2 +- .../components/three/HalftoneThreeDemo.vue | 2 +- .../components/three/PixelationThreeDemo.vue | 2 +- .../theme/components/three/SMAAThreeDemo.vue | 2 +- .../components/three/UnrealBloomThreeDemo.vue | 2 +- .../theme/composables/useRouteDisposal.ts | 4 +- docs/guide/index.md | 18 +- docs/guide/pmndrs/bloom.md | 8 +- docs/guide/pmndrs/depth-of-field.md | 8 +- docs/guide/pmndrs/glitch.md | 8 +- docs/guide/pmndrs/noise.md | 8 +- docs/guide/pmndrs/outline.md | 8 +- docs/guide/pmndrs/pixelation.md | 8 +- docs/guide/pmndrs/vignette.md | 8 +- docs/guide/three/glitch.md | 2 +- docs/guide/three/halftone.md | 2 +- docs/guide/three/pixelation.md | 2 +- docs/guide/three/smaa.md | 2 +- docs/guide/three/unreal-bloom.md | 2 +- docs/tsconfig.json | 5 +- package.json | 37 +- playground-nuxt/.gitignore | 24 - playground-nuxt/.npmrc | 1 - playground-nuxt/README.md | 75 - playground-nuxt/app.vue | 5 - playground-nuxt/nuxt.config.ts | 19 - playground-nuxt/package.json | 24 - playground-nuxt/pages/index.vue | 34 - playground-nuxt/public/favicon.ico | Bin 4286 -> 0 bytes playground-nuxt/server/tsconfig.json | 3 - playground-nuxt/tsconfig.json | 4 - playground/package.json | 1 + playground/src/components/BasicScene.vue | 2 +- playground/src/components/OutlineDemo.vue | 2 +- playground/src/components/TheExperience.vue | 2 +- playground/src/pages/postprocessing/bloom.vue | 8 +- .../pages/postprocessing/depth-of-field.vue | 8 +- .../src/pages/postprocessing/glitch.vue | 8 +- playground/src/pages/postprocessing/noise.vue | 8 +- .../src/pages/postprocessing/on-demand.vue | 8 +- .../src/pages/postprocessing/outline.vue | 8 +- .../src/pages/postprocessing/pixelation.vue | 8 +- .../src/pages/postprocessing/vignette.vue | 10 +- playground/src/pages/three/glitch.vue | 2 +- playground/src/pages/three/halftone.vue | 2 +- playground/src/pages/three/pixelation.vue | 2 +- playground/src/pages/three/smaa.vue | 2 +- playground/src/pages/three/unreal-bloom.vue | 2 +- playground/vite.config.ts | 3 +- pnpm-lock.yaml | 10976 +++------------- .../pmndrs/{Bloom.vue => BloomPmndrs.vue} | 18 +- ...epthOfField.vue => DepthOfFieldPmndrs.vue} | 8 +- ...tComposer.vue => EffectComposerPmndrs.vue} | 6 +- .../pmndrs/{Glitch.vue => GlitchPmndrs.vue} | 8 +- .../pmndrs/{Noise.vue => NoisePmndrs.vue} | 8 +- .../pmndrs/{Outline.vue => OutlinePmndrs.vue} | 8 +- .../{Pixelation.vue => PixelationPmndrs.vue} | 8 +- .../{Vignette.vue => VignettePmndrs.vue} | 8 +- .../{useEffect.ts => useEffectPmndrs.ts} | 4 +- src/core/pmndrs/index.ts | 52 +- src/index.ts | 2 + vite.config.ts | 11 +- 70 files changed, 1962 insertions(+), 9633 deletions(-) delete mode 100644 playground-nuxt/.gitignore delete mode 100644 playground-nuxt/.npmrc delete mode 100644 playground-nuxt/README.md delete mode 100644 playground-nuxt/app.vue delete mode 100644 playground-nuxt/nuxt.config.ts delete mode 100644 playground-nuxt/package.json delete mode 100644 playground-nuxt/pages/index.vue delete mode 100644 playground-nuxt/public/favicon.ico delete mode 100644 playground-nuxt/server/tsconfig.json delete mode 100644 playground-nuxt/tsconfig.json rename src/core/pmndrs/{Bloom.vue => BloomPmndrs.vue} (81%) rename src/core/pmndrs/{DepthOfField.vue => DepthOfFieldPmndrs.vue} (86%) rename src/core/pmndrs/{EffectComposer.vue => EffectComposerPmndrs.vue} (95%) rename src/core/pmndrs/{Glitch.vue => GlitchPmndrs.vue} (89%) rename src/core/pmndrs/{Noise.vue => NoisePmndrs.vue} (74%) rename src/core/pmndrs/{Outline.vue => OutlinePmndrs.vue} (93%) rename src/core/pmndrs/{Pixelation.vue => PixelationPmndrs.vue} (59%) rename src/core/pmndrs/{Vignette.vue => VignettePmndrs.vue} (73%) rename src/core/pmndrs/composables/{useEffect.ts => useEffectPmndrs.ts} (91%) create mode 100644 src/index.ts diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 0f57f6eb..e437b3a5 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -88,8 +88,7 @@ export default defineConfig({ }, resolve: { alias: { - '@tresjs/post-processing/three': resolve(__dirname, '../../src/core/three'), - '@tresjs/post-processing/pmndrs': resolve(__dirname, '../../src/core/pmndrs'), + '@tresjs/post-processing': resolve(__dirname, '../../src'), }, dedupe: ['three', '@tresjs/core'], }, diff --git a/docs/.vitepress/theme/components/pmdrs/BloomDemo.vue b/docs/.vitepress/theme/components/pmdrs/BloomDemo.vue index 524f2a1c..d72abb11 100644 --- a/docs/.vitepress/theme/components/pmdrs/BloomDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/BloomDemo.vue @@ -1,6 +1,6 @@ ``` -### Using pmndrs effects +### Using Pmndrs effects + +You can also use Pmndrs `postprocessing` effects, but you need to use the `EffectComposerPmndrs` component instead of `EffectComposer` and suffix the effects with `Pmndrs`. ```html ``` diff --git a/docs/guide/pmndrs/bloom.md b/docs/guide/pmndrs/bloom.md index fecdb52c..e584e14f 100644 --- a/docs/guide/pmndrs/bloom.md +++ b/docs/guide/pmndrs/bloom.md @@ -10,19 +10,19 @@ Bloom is an effect that simulates the way that bright objects in the real world ```vue ``` diff --git a/docs/guide/pmndrs/depth-of-field.md b/docs/guide/pmndrs/depth-of-field.md index 1af9b52b..90255f52 100644 --- a/docs/guide/pmndrs/depth-of-field.md +++ b/docs/guide/pmndrs/depth-of-field.md @@ -12,13 +12,13 @@ This photographic technique allows photographers and filmmakers to draw attentio ```vue ``` diff --git a/docs/guide/pmndrs/glitch.md b/docs/guide/pmndrs/glitch.md index 63dec57b..37714c71 100644 --- a/docs/guide/pmndrs/glitch.md +++ b/docs/guide/pmndrs/glitch.md @@ -16,13 +16,13 @@ This effect may potentially cause epileptic seizures in people with photosensiti ```vue ``` diff --git a/docs/guide/pmndrs/noise.md b/docs/guide/pmndrs/noise.md index 5116a46b..55d2c37a 100644 --- a/docs/guide/pmndrs/noise.md +++ b/docs/guide/pmndrs/noise.md @@ -10,18 +10,18 @@ Noise is an effect that adds Gaussian noise to the scene. This can be used to si ```vue ``` diff --git a/docs/guide/pmndrs/outline.md b/docs/guide/pmndrs/outline.md index 7cdd62ab..3deb045d 100644 --- a/docs/guide/pmndrs/outline.md +++ b/docs/guide/pmndrs/outline.md @@ -10,13 +10,13 @@ Outline is an effect that applies an outline to objects in your scene. This effe ```vue ``` diff --git a/docs/guide/pmndrs/pixelation.md b/docs/guide/pmndrs/pixelation.md index 381359cd..b4330b04 100644 --- a/docs/guide/pmndrs/pixelation.md +++ b/docs/guide/pmndrs/pixelation.md @@ -10,13 +10,13 @@ Pixelation is an effect that pixelates the scene. ```vue ``` diff --git a/docs/guide/pmndrs/vignette.md b/docs/guide/pmndrs/vignette.md index a8a1cb45..23d4836f 100644 --- a/docs/guide/pmndrs/vignette.md +++ b/docs/guide/pmndrs/vignette.md @@ -10,16 +10,16 @@ Vignette is an effect that darkens the edges of the scene to make the center pop ```vue ``` diff --git a/docs/guide/three/glitch.md b/docs/guide/three/glitch.md index fca973ca..037e3b93 100644 --- a/docs/guide/three/glitch.md +++ b/docs/guide/three/glitch.md @@ -16,7 +16,7 @@ This effect may potentially cause epileptic seizures in people with photosensiti ```vue