From 567a8982bc828ebac6e2f265d290c22999afefb6 Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Thu, 6 May 2021 22:42:23 +0200 Subject: [PATCH] fix import --- src/components/postprocessing/vanruesc/Effect.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/postprocessing/vanruesc/Effect.js b/src/components/postprocessing/vanruesc/Effect.js index 95f3d2b..fdf7247 100644 --- a/src/components/postprocessing/vanruesc/Effect.js +++ b/src/components/postprocessing/vanruesc/Effect.js @@ -1,6 +1,6 @@ import { defineComponent, inject, onMounted, onUnmounted } from 'vue' import { LoadingManager } from 'three' -import * as PP from 'postprocessing' +import { BloomEffect, DepthOfFieldEffect, EdgeDetectionMode, GodRaysEffect, SMAAEffect, SMAAImageLoader, SMAAPreset } from 'postprocessing' import { EffectPassInjectionKey } from './EffectPass' // type EffectTypes = 'bloom' | 'dof' | 'godrays' | 'smaa' @@ -33,7 +33,7 @@ export default defineComponent({ onMounted(() => { if (props.type === 'smaa') { - const smaaImageLoader = new PP.SMAAImageLoader(new LoadingManager()) + const smaaImageLoader = new SMAAImageLoader(new LoadingManager()) smaaImageLoader.load(([search, area]) => { initEffect({ smaaSearch: search, smaaArea: area }) }) @@ -56,10 +56,10 @@ function createEffect(effectPass, type, options, assets) { let effect switch (type) { case 'bloom' : - effect = new PP.BloomEffect(options) + effect = new BloomEffect(options) break case 'dof' : - effect = new PP.DepthOfFieldEffect(effectPass.composer.renderer, options) + effect = new DepthOfFieldEffect(effectPass.composer.renderer, options) break case 'godrays' : effect = createGodraysEffect(effectPass, options) @@ -73,8 +73,8 @@ function createEffect(effectPass, type, options, assets) { function createSmaaEffect(options, assets) { const { smaaSearch, smaaArea } = assets - const params = [options.preset ?? PP.SMAAPreset.HIGH, options.edgeDetectionMode ?? PP.EdgeDetectionMode.COLOR] - return new PP.SMAAEffect(smaaSearch, smaaArea, ...params) + const params = [options.preset ?? SMAAPreset.HIGH, options.edgeDetectionMode ?? EdgeDetectionMode.COLOR] + return new SMAAEffect(smaaSearch, smaaArea, ...params) } function createGodraysEffect(effectPass, options) { @@ -92,5 +92,5 @@ function createGodraysEffect(effectPass, options) { return } - return new PP.GodRaysEffect(effectPass.composer.renderer.camera, lightSourceComp.mesh, opts) + return new GodRaysEffect(effectPass.composer.renderer.camera, lightSourceComp.mesh, opts) }