From bf6bb05b799019500b60a8169a521195d3e8302f Mon Sep 17 00:00:00 2001 From: Damien Montastier Date: Thu, 30 Jan 2025 18:55:54 +0100 Subject: [PATCH 01/10] migrate to new tresleches, change devDependencies package.json file --- .../theme/components/pmdrs/BarrelBlurDemo.vue | 2 +- .../pmdrs/ChromaticAberrationDemo.vue | 6 +- .../components/pmdrs/ColorAverageDemo.vue | 4 +- .../theme/components/pmdrs/DotScreenDemo.vue | 2 +- .../components/pmdrs/HueSaturationDemo.vue | 2 +- .../theme/components/pmdrs/KuwaharaDemo.vue | 6 +- .../components/pmdrs/LensDistortionDemo.vue | 8 +- .../theme/components/pmdrs/LinocutDemo.vue | 10 +- .../theme/components/pmdrs/ScanlineDemo.vue | 2 +- .../theme/components/pmdrs/SepiaDemo.vue | 2 +- .../theme/components/pmdrs/ShockWaveDemo.vue | 6 +- .../theme/components/pmdrs/TiltShiftDemo.vue | 10 +- .../components/pmdrs/ToneMappingDemo.vue | 4 +- docs/package.json | 1 - package.json | 1 + playground/package.json | 1 - .../src/pages/postprocessing/barrel-blur.vue | 2 +- playground/src/pages/postprocessing/bloom.vue | 14 +- .../postprocessing/chromatic-aberration.vue | 6 +- .../pages/postprocessing/color-average.vue | 2 +- .../pages/postprocessing/depth-of-field.vue | 2 +- .../src/pages/postprocessing/dot-screen.vue | 2 +- .../src/pages/postprocessing/glitch.vue | 18 +- .../pages/postprocessing/hue-saturation.vue | 2 +- .../src/pages/postprocessing/kuwahara.vue | 2 +- .../pages/postprocessing/lens-distortion.vue | 8 +- .../src/pages/postprocessing/linocut.vue | 10 +- playground/src/pages/postprocessing/noise.vue | 7 +- .../src/pages/postprocessing/outline.vue | 10 +- .../src/pages/postprocessing/scanline.vue | 2 +- playground/src/pages/postprocessing/sepia.vue | 2 +- .../src/pages/postprocessing/shock-wave.vue | 4 +- .../src/pages/postprocessing/tilt-shift.vue | 18 +- .../src/pages/postprocessing/tone-mapping.vue | 3 +- .../src/pages/postprocessing/vignette.vue | 4 +- pnpm-lock.yaml | 645 +++++++++++++++++- 36 files changed, 727 insertions(+), 103 deletions(-) diff --git a/docs/.vitepress/theme/components/pmdrs/BarrelBlurDemo.vue b/docs/.vitepress/theme/components/pmdrs/BarrelBlurDemo.vue index ed54ad00..a4f4dad4 100644 --- a/docs/.vitepress/theme/components/pmdrs/BarrelBlurDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/BarrelBlurDemo.vue @@ -56,7 +56,7 @@ const { amount, offsetX, offsetY, blendFunction } = useControls({ - + diff --git a/docs/.vitepress/theme/components/pmdrs/ChromaticAberrationDemo.vue b/docs/.vitepress/theme/components/pmdrs/ChromaticAberrationDemo.vue index 8a28e9aa..207408c6 100644 --- a/docs/.vitepress/theme/components/pmdrs/ChromaticAberrationDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/ChromaticAberrationDemo.vue @@ -8,6 +8,8 @@ import { ChromaticAberrationPmndrs, EffectComposerPmndrs } from '@tresjs/post-pr import '@tresjs/leches/styles' +// TODO: Adapt watchEffect to useControls for visibility of modulationOffset + const gl = { clearColor: '#ffffff', toneMapping: NoToneMapping, @@ -24,7 +26,7 @@ const { offsetX, offsetY, radialModulation, modulationOffset } = useControls({ }) watchEffect(() => { - modulationOffset.value.visible = radialModulation.value.value + // modulationOffset.value.visible = radialModulation.value.value }) @@ -69,7 +71,7 @@ watchEffect(() => { - + diff --git a/docs/.vitepress/theme/components/pmdrs/ColorAverageDemo.vue b/docs/.vitepress/theme/components/pmdrs/ColorAverageDemo.vue index 634dbddd..11b78415 100644 --- a/docs/.vitepress/theme/components/pmdrs/ColorAverageDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/ColorAverageDemo.vue @@ -39,7 +39,7 @@ const { blendFunction, opacity } = useControls({ function onUpdateTimeline(e) { const progress = 1 - e.progress() - opacity.value.value = progress + opacity.value = progress } watch(meshRef, () => { @@ -85,7 +85,7 @@ onUnmounted(() => { - + diff --git a/docs/.vitepress/theme/components/pmdrs/DotScreenDemo.vue b/docs/.vitepress/theme/components/pmdrs/DotScreenDemo.vue index 5be563d4..e3a05ee4 100644 --- a/docs/.vitepress/theme/components/pmdrs/DotScreenDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/DotScreenDemo.vue @@ -55,7 +55,7 @@ const { scene } = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets - + diff --git a/docs/.vitepress/theme/components/pmdrs/HueSaturationDemo.vue b/docs/.vitepress/theme/components/pmdrs/HueSaturationDemo.vue index ed365cc7..59df7c59 100644 --- a/docs/.vitepress/theme/components/pmdrs/HueSaturationDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/HueSaturationDemo.vue @@ -50,7 +50,7 @@ const { saturation, hue, blendFunction } = useControls({ - + diff --git a/docs/.vitepress/theme/components/pmdrs/KuwaharaDemo.vue b/docs/.vitepress/theme/components/pmdrs/KuwaharaDemo.vue index 13660275..55f4887d 100644 --- a/docs/.vitepress/theme/components/pmdrs/KuwaharaDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/KuwaharaDemo.vue @@ -28,8 +28,8 @@ const { enabled, radius, sectorCount } = useControls({ sectorCount: { value: 4, min: 1, max: 8, step: 1 }, }) -watch(enabled.value, () => { - effectProps.blendFunction = enabled.value.value ? BlendFunction.NORMAL : BlendFunction.SKIP +watch(enabled, () => { + effectProps.blendFunction = enabled.value ? BlendFunction.NORMAL : BlendFunction.SKIP }) @@ -72,7 +72,7 @@ watch(enabled.value, () => { - + diff --git a/docs/.vitepress/theme/components/pmdrs/LensDistortionDemo.vue b/docs/.vitepress/theme/components/pmdrs/LensDistortionDemo.vue index c8210fbc..7f1d65d8 100644 --- a/docs/.vitepress/theme/components/pmdrs/LensDistortionDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/LensDistortionDemo.vue @@ -57,10 +57,10 @@ pbrTexture.map.colorSpace = SRGBColorSpace diff --git a/docs/.vitepress/theme/components/pmdrs/LinocutDemo.vue b/docs/.vitepress/theme/components/pmdrs/LinocutDemo.vue index c38c9ff0..ff899f20 100644 --- a/docs/.vitepress/theme/components/pmdrs/LinocutDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/LinocutDemo.vue @@ -61,11 +61,11 @@ const { blendFunction, scale, noiseScale, centerX, centerY, rotation } = useCont diff --git a/docs/.vitepress/theme/components/pmdrs/ScanlineDemo.vue b/docs/.vitepress/theme/components/pmdrs/ScanlineDemo.vue index 25f45c0b..b7ebd23f 100644 --- a/docs/.vitepress/theme/components/pmdrs/ScanlineDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/ScanlineDemo.vue @@ -62,7 +62,7 @@ const { blendFunction, opacity, density, scrollSpeed } = useControls({ - + diff --git a/docs/.vitepress/theme/components/pmdrs/SepiaDemo.vue b/docs/.vitepress/theme/components/pmdrs/SepiaDemo.vue index 76b93bad..3720d33b 100644 --- a/docs/.vitepress/theme/components/pmdrs/SepiaDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/SepiaDemo.vue @@ -54,7 +54,7 @@ const { intensity, blendFunction } = useControls({ - + diff --git a/docs/.vitepress/theme/components/pmdrs/ShockWaveDemo.vue b/docs/.vitepress/theme/components/pmdrs/ShockWaveDemo.vue index f6e06858..01178bfe 100644 --- a/docs/.vitepress/theme/components/pmdrs/ShockWaveDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/ShockWaveDemo.vue @@ -141,8 +141,8 @@ function getActiveDuration() { // Note that the speed affects how quickly the shock wave radius increases over time, but not the total duration of the emit explode. // Retrieve the values dynamically - const radiusMax = maxRadius.value.value - const wave = waveSize.value.value + const radiusMax = maxRadius.value + const wave = waveSize.value // Duration formula: 2 * maxRadius + 3 * waveSize const duration = 2 * radiusMax + 3 * wave @@ -196,7 +196,7 @@ onUnmounted(() => { - + diff --git a/docs/.vitepress/theme/components/pmdrs/TiltShiftDemo.vue b/docs/.vitepress/theme/components/pmdrs/TiltShiftDemo.vue index 79627c19..2b7b6041 100644 --- a/docs/.vitepress/theme/components/pmdrs/TiltShiftDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/TiltShiftDemo.vue @@ -65,11 +65,11 @@ const { blendFunction, offset, rotation, focusArea, feather } = useControls({ diff --git a/docs/.vitepress/theme/components/pmdrs/ToneMappingDemo.vue b/docs/.vitepress/theme/components/pmdrs/ToneMappingDemo.vue index 6f7f1cb8..9c3782aa 100644 --- a/docs/.vitepress/theme/components/pmdrs/ToneMappingDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/ToneMappingDemo.vue @@ -45,7 +45,7 @@ onUnmounted(() => { { - + diff --git a/docs/package.json b/docs/package.json index 4725848e..da956453 100644 --- a/docs/package.json +++ b/docs/package.json @@ -15,7 +15,6 @@ "gsap": "^3.12.7" }, "devDependencies": { - "@tresjs/leches": "^0.14.1", "unocss": "^65.4.3", "unplugin-vue-components": "^28.0.0", "vite-svg-loader": "^5.1.0", diff --git a/package.json b/package.json index 77bd6ed5..f2ccf6e9 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "postprocessing": "^6.36.6" }, "devDependencies": { + "@tresjs/leches": "https://pkg.pr.new/@tresjs/leches@9ad0cd3", "@release-it/conventional-changelog": "^10.0.0", "@tresjs/core": "^4.3.2", "@tresjs/eslint-config": "^1.4.0", diff --git a/playground/package.json b/playground/package.json index 273abb5a..4296a453 100644 --- a/playground/package.json +++ b/playground/package.json @@ -15,7 +15,6 @@ "vue-router": "^4.5.0" }, "devDependencies": { - "@tresjs/leches": "^0.14.1", "@types/three": "^0.172.0", "unplugin-auto-import": "^19.0.0", "unplugin-vue-components": "^28.0.0", diff --git a/playground/src/pages/postprocessing/barrel-blur.vue b/playground/src/pages/postprocessing/barrel-blur.vue index f1c383bb..815897b0 100644 --- a/playground/src/pages/postprocessing/barrel-blur.vue +++ b/playground/src/pages/postprocessing/barrel-blur.vue @@ -84,7 +84,7 @@ const { blendFunction, amount, offsetX, offsetY } = useControls({ - + diff --git a/playground/src/pages/postprocessing/bloom.vue b/playground/src/pages/postprocessing/bloom.vue index a85dfcae..73625cfe 100644 --- a/playground/src/pages/postprocessing/bloom.vue +++ b/playground/src/pages/postprocessing/bloom.vue @@ -127,13 +127,13 @@ onMounted(() => { diff --git a/playground/src/pages/postprocessing/chromatic-aberration.vue b/playground/src/pages/postprocessing/chromatic-aberration.vue index bbc25bcb..8378b9a0 100644 --- a/playground/src/pages/postprocessing/chromatic-aberration.vue +++ b/playground/src/pages/postprocessing/chromatic-aberration.vue @@ -9,6 +9,8 @@ import { ChromaticAberrationPmndrs, EffectComposerPmndrs } from '@tresjs/post-pr import '@tresjs/leches/styles' +// TODO: Adapt watchEffect to useControls for visibility of modulationOffset + const gl = { clearColor: '#ffffff', toneMapping: NoToneMapping, @@ -31,7 +33,7 @@ const { offsetX, offsetY, radialModulation, modulationOffset, blendFunction } = }) watchEffect(() => { - modulationOffset.value.visible = radialModulation.value.value + // modulationOffset.value.visible = radialModulation.value.value }) @@ -59,7 +61,7 @@ watchEffect(() => { - + diff --git a/playground/src/pages/postprocessing/color-average.vue b/playground/src/pages/postprocessing/color-average.vue index 6206f056..f56b3523 100644 --- a/playground/src/pages/postprocessing/color-average.vue +++ b/playground/src/pages/postprocessing/color-average.vue @@ -59,7 +59,7 @@ const { blendFunction, opacity } = useControls({ - + diff --git a/playground/src/pages/postprocessing/depth-of-field.vue b/playground/src/pages/postprocessing/depth-of-field.vue index 8e3f100d..e580a246 100644 --- a/playground/src/pages/postprocessing/depth-of-field.vue +++ b/playground/src/pages/postprocessing/depth-of-field.vue @@ -49,7 +49,7 @@ const effectParams = computed(() => Object .entries(controls) .reduce( - (acc, [key, value]) => ({ ...acc, [key]: value.value.value }) + (acc, [key, value]) => ({ ...acc, [key]: value.value }) , {}, ), ) diff --git a/playground/src/pages/postprocessing/dot-screen.vue b/playground/src/pages/postprocessing/dot-screen.vue index 7fd1876e..1adb41c9 100644 --- a/playground/src/pages/postprocessing/dot-screen.vue +++ b/playground/src/pages/postprocessing/dot-screen.vue @@ -49,7 +49,7 @@ const { angle, scale, blendFunction } = useControls({ - + diff --git a/playground/src/pages/postprocessing/glitch.vue b/playground/src/pages/postprocessing/glitch.vue index 1b331f29..cf1640bb 100644 --- a/playground/src/pages/postprocessing/glitch.vue +++ b/playground/src/pages/postprocessing/glitch.vue @@ -81,15 +81,15 @@ pane.addInput(glitchParams, 'dtSize', { min: 1, max: 64, step: 1 }) */ diff --git a/playground/src/pages/postprocessing/hue-saturation.vue b/playground/src/pages/postprocessing/hue-saturation.vue index b9c5e09f..c3c5c6f5 100644 --- a/playground/src/pages/postprocessing/hue-saturation.vue +++ b/playground/src/pages/postprocessing/hue-saturation.vue @@ -49,7 +49,7 @@ const { saturation, hue, blendFunction } = useControls({ - + diff --git a/playground/src/pages/postprocessing/kuwahara.vue b/playground/src/pages/postprocessing/kuwahara.vue index 8207d0b8..51f7f7ff 100644 --- a/playground/src/pages/postprocessing/kuwahara.vue +++ b/playground/src/pages/postprocessing/kuwahara.vue @@ -51,7 +51,7 @@ const { radius, blendFunction, sectorCount } = useControls({ - + diff --git a/playground/src/pages/postprocessing/lens-distortion.vue b/playground/src/pages/postprocessing/lens-distortion.vue index b87d33fd..824ecb00 100644 --- a/playground/src/pages/postprocessing/lens-distortion.vue +++ b/playground/src/pages/postprocessing/lens-distortion.vue @@ -43,10 +43,10 @@ const { distortion, principalPoint, focalLength, skew } = useControls({ diff --git a/playground/src/pages/postprocessing/linocut.vue b/playground/src/pages/postprocessing/linocut.vue index 0a6c1b9d..4249af54 100644 --- a/playground/src/pages/postprocessing/linocut.vue +++ b/playground/src/pages/postprocessing/linocut.vue @@ -63,11 +63,11 @@ const { blendFunction, scale, noiseScale, centerX, centerY, rotation } = useCont diff --git a/playground/src/pages/postprocessing/noise.vue b/playground/src/pages/postprocessing/noise.vue index fd27d96e..516fe5b4 100644 --- a/playground/src/pages/postprocessing/noise.vue +++ b/playground/src/pages/postprocessing/noise.vue @@ -15,11 +15,11 @@ const gl = { outputColorSpace: SRGBColorSpace, toneMapping: NoToneMapping, } -const { value: premultiply } = useControls({ +const { premultiply } = useControls({ premultiply: true, }) -const { value: blendFunction } = useControls({ +const { blendFunction } = useControls({ blendFunction: { options: Object.keys(BlendFunction).map(key => ({ text: key, @@ -28,6 +28,7 @@ const { value: blendFunction } = useControls({ value: BlendFunction.SCREEN, }, }) +