diff --git a/CHANGELOG.md b/CHANGELOG.md index fb44d01e..09c2bbd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.4.0](https://github.com/Tresjs/post-processing/compare/2.3.1...2.4.0) (2025-05-26) + +### Features + +* ASCII ([#200](https://github.com/Tresjs/post-processing/issues/200)) ([c5dba7c](https://github.com/Tresjs/post-processing/commit/c5dba7c615f7dc7d985658193ca2794a329b122d)) +* FXAA ([#197](https://github.com/Tresjs/post-processing/issues/197)) ([fba8b58](https://github.com/Tresjs/post-processing/commit/fba8b58dc4e7d9bb380e0931e700b0723deb7f7c)) +* SMAA ([#199](https://github.com/Tresjs/post-processing/issues/199)) ([0a89733](https://github.com/Tresjs/post-processing/commit/0a89733d567b6502a0fef38bda8432ea66b2fb76)) +* texture ([#202](https://github.com/Tresjs/post-processing/issues/202)) ([07a9ff5](https://github.com/Tresjs/post-processing/commit/07a9ff51dfb142eb0386f52471fb5905d900754f)) + +### Bug Fixes + +* big clean demo — docs — bad using multisampling ([#201](https://github.com/Tresjs/post-processing/issues/201)) ([38002a6](https://github.com/Tresjs/post-processing/commit/38002a6a58b955da9235130af217c251d569d79e)) + ## [2.3.1](https://github.com/Tresjs/post-processing/compare/2.3.0...2.3.1) (2025-03-29) ### Bug Fixes diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index e22b8786..2bb83e0d 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -61,6 +61,10 @@ export default defineConfig({ { text: 'Hue & Saturation', link: '/guide/pmndrs/hue-saturation' }, { text: 'Lens Distortion', link: '/guide/pmndrs/lens-distortion' }, { text: 'Grid', link: '/guide/pmndrs/grid' }, + { text: 'Texture', link: '/guide/pmndrs/texture' }, + { text: 'ASCII', link: '/guide/pmndrs/ascii' }, + { text: 'FXAA', link: '/guide/pmndrs/fxaa' }, + { text: 'SMAA', link: '/guide/pmndrs/smaa' }, { text: 'Kuwahara', link: '/guide/pmndrs/kuwahara' }, { text: 'Color Average', link: '/guide/pmndrs/color-average' }, { text: 'Depth of Field', link: '/guide/pmndrs/depth-of-field' }, @@ -86,6 +90,12 @@ export default defineConfig({ { text: 'Unreal Bloom', link: '/guide/three/unreal-bloom' }, ].sort((a, b) => a.text.localeCompare(b.text)), }, + { + text: 'Advanced', + items: [ + { text: 'You might not need this module', link: '/guide/advanced/you-might-not-need-post-processing' }, + ], + }, ], socialLinks: [ diff --git a/docs/.vitepress/theme/components/pmdrs/ASCIIDemo.vue b/docs/.vitepress/theme/components/pmdrs/ASCIIDemo.vue new file mode 100644 index 00000000..ef9239a9 --- /dev/null +++ b/docs/.vitepress/theme/components/pmdrs/ASCIIDemo.vue @@ -0,0 +1,96 @@ + + + diff --git a/docs/.vitepress/theme/components/pmdrs/BrightnessContrastDemo.vue b/docs/.vitepress/theme/components/pmdrs/BrightnessContrastDemo.vue index 35c95187..299c6a59 100644 --- a/docs/.vitepress/theme/components/pmdrs/BrightnessContrastDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/BrightnessContrastDemo.vue @@ -11,7 +11,6 @@ import '@tresjs/leches/styles' const gl = { clearColor: '#ffffff', toneMapping: NoToneMapping, - multisampling: 8, } const { brightness, contrast, blendFunction } = useControls({ @@ -20,7 +19,7 @@ const { brightness, contrast, blendFunction } = useControls({ blendFunction: { options: Object.keys(BlendFunction).map(key => ({ text: key, - value: BlendFunction[key], + value: BlendFunction[key as keyof typeof BlendFunction], })), value: BlendFunction.SRC, }, diff --git a/docs/.vitepress/theme/components/pmdrs/ColorAverageDemo.vue b/docs/.vitepress/theme/components/pmdrs/ColorAverageDemo.vue index 84ada864..3e82eede 100644 --- a/docs/.vitepress/theme/components/pmdrs/ColorAverageDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/ColorAverageDemo.vue @@ -14,7 +14,6 @@ import '@tresjs/leches/styles' const gl = { clearColor: '#ffffff', toneMapping: NoToneMapping, - envMapIntensity: 10, } const glComposer = { diff --git a/docs/.vitepress/theme/components/pmdrs/ColorDepthDemo.vue b/docs/.vitepress/theme/components/pmdrs/ColorDepthDemo.vue index ca9345d8..b93d5f91 100644 --- a/docs/.vitepress/theme/components/pmdrs/ColorDepthDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/ColorDepthDemo.vue @@ -14,7 +14,6 @@ import '@tresjs/leches/styles' const gl = { clearColor: '#ffffff', toneMapping: NoToneMapping, - multisampling: 8, } const ctx = gsap.context(() => {}) diff --git a/docs/.vitepress/theme/components/pmdrs/FXAADemo.vue b/docs/.vitepress/theme/components/pmdrs/FXAADemo.vue new file mode 100644 index 00000000..f064d54b --- /dev/null +++ b/docs/.vitepress/theme/components/pmdrs/FXAADemo.vue @@ -0,0 +1,178 @@ + + + + + diff --git a/docs/.vitepress/theme/components/pmdrs/FishEyeDemo.vue b/docs/.vitepress/theme/components/pmdrs/FishEyeDemo.vue index fb5431cf..7c9c3d11 100644 --- a/docs/.vitepress/theme/components/pmdrs/FishEyeDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/FishEyeDemo.vue @@ -15,7 +15,6 @@ import '@tresjs/leches/styles' const gl = { clearColor: '#ffffff', toneMapping: NoToneMapping, - multisampling: 8, } const lensParams = [ diff --git a/docs/.vitepress/theme/components/pmdrs/GodRaysDemo.vue b/docs/.vitepress/theme/components/pmdrs/GodRaysDemo.vue index dd4af009..962dbf84 100644 --- a/docs/.vitepress/theme/components/pmdrs/GodRaysDemo.vue +++ b/docs/.vitepress/theme/components/pmdrs/GodRaysDemo.vue @@ -6,30 +6,25 @@ import type { Mesh } from 'three' import { BackSide, NoToneMapping } from 'three' import { BlendFunction, KernelSize } from 'postprocessing' import { EffectComposerPmndrs, GodRaysPmndrs } from '@tresjs/post-processing' -import { ref, watch } from 'vue' +import { onUnmounted, ref, watch } from 'vue' import { gsap } from 'gsap' import '@tresjs/leches/styles' const gl = { toneMapping: NoToneMapping, - multisampling: 8, } +let tween: gsap.core.Tween | null = null + const sphereMeshRef = ref(null) const pbrTexture = await useTexture({ map: '/lens-distortion/room-map.png', }) -const { blur, kernelSize, resolutionScale, opacity, blendFunction, density, decay, weight, exposure, samples, clampMax } = useControls({ - blendFunction: { - options: Object.keys(BlendFunction).map(key => ({ - text: key, - value: BlendFunction[key as keyof typeof BlendFunction], - })), - value: BlendFunction.SCREEN, - }, +const { freezeAnimationLightSource, blur, kernelSize, resolutionScale, opacity, blendFunction, density, decay, weight, exposure, samples, clampMax } = useControls({ + freezeAnimationLightSource: { value: false, label: 'pauseLightSource', type: 'boolean' }, kernelSize: { options: Object.keys(KernelSize).map(key => ({ text: key, @@ -46,6 +41,13 @@ const { blur, kernelSize, resolutionScale, opacity, blendFunction, density, deca clampMax: { value: 1.0, step: 0.1, max: 1.0 }, resolutionScale: { value: 0.5, step: 0.1, min: 0.1, max: 1.0 }, blur: true, + blendFunction: { + options: Object.keys(BlendFunction).map(key => ({ + text: key, + value: BlendFunction[key as keyof typeof BlendFunction], + })), + value: BlendFunction.SCREEN, + }, }) const torusMeshes = [ @@ -57,14 +59,30 @@ const torusMeshes = [ watch(sphereMeshRef, () => { if (!sphereMeshRef.value) { return } - gsap.to(sphereMeshRef.value.position, { + tween = gsap.to(sphereMeshRef.value.position, { x: 20, duration: 3, repeat: -1, yoyo: true, + paused: freezeAnimationLightSource.value, ease: 'sine.inOut', }) }) + +watch(freezeAnimationLightSource, () => { + if (!sphereMeshRef.value) { return } + + if (freezeAnimationLightSource.value) { + tween?.pause() + } + else { + tween?.resume() + } +}) + +onUnmounted(() => { + tween?.revert() +})