diff --git a/src/components/postprocessing/vanruesc/Effect.ts b/src/components/postprocessing/vanruesc/Effect.ts index d3f1df7..a10048e 100644 --- a/src/components/postprocessing/vanruesc/Effect.ts +++ b/src/components/postprocessing/vanruesc/Effect.ts @@ -10,6 +10,7 @@ export default defineComponent({ props: { type: { type: String as PropType, required: true }, options: { type: Object, default: () => ({}) }, + onReady: Function, }, setup(props) { const effectPass = inject(EffectPassInjectionKey) @@ -27,6 +28,7 @@ export default defineComponent({ console.error('Invalid effect type') return } + props.onReady?.(effect) effectPass.addEffect(effect, effectIndex) } @@ -78,7 +80,9 @@ function createEffect( function createSmaaEffect(options: Record, assets: any): PP.Pass { const { smaaSearch, smaaArea } = assets // TODO : options - return new PP.SMAAEffect(smaaSearch, smaaArea) + const params = [options.preset ?? PP.SMAAPreset.HIGH, options.edgeDetectionMode ?? PP.EdgeDetectionMode.COLOR] + console.log(params) + return new PP.SMAAEffect(smaaSearch, smaaArea, ...params) } function createGodraysEffect(effectPass: EffectPassInterface, options: Record): PP.Pass { diff --git a/src/components/postprocessing/vanruesc/Pass.ts b/src/components/postprocessing/vanruesc/Pass.ts index bf2a832..5b8895f 100644 --- a/src/components/postprocessing/vanruesc/Pass.ts +++ b/src/components/postprocessing/vanruesc/Pass.ts @@ -13,6 +13,7 @@ export default defineComponent({ options: { type: Object, default: () => ({}) }, // needsSwap: { type: Boolean, default: false }, renderToScreen: { type: Boolean, default: false }, + onReady: Function, }, setup(props) { const composer = inject(ComposerInjectionKey) @@ -31,6 +32,7 @@ export default defineComponent({ return } pass.renderToScreen = props.renderToScreen + props.onReady?.(pass) composer.composer.addPass(pass, passIndex) }