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/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() +})