From af603b83854800501fb57e8975dacf6dce2aef68 Mon Sep 17 00:00:00 2001 From: Cody Bennett Date: Tue, 24 Oct 2023 13:35:26 -0500 Subject: [PATCH] fix(EffectComposer): don't merge when convolution is head --- src/EffectComposer.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/EffectComposer.tsx b/src/EffectComposer.tsx index 23e80569..f4490cd4 100644 --- a/src/EffectComposer.tsx +++ b/src/EffectComposer.tsx @@ -141,11 +141,13 @@ export const EffectComposer = React.memo( if (child instanceof Effect) { const effects: Effect[] = [child] - let next: unknown = null - while ((next = children[i + 1]) instanceof Effect) { - if (isConvolution(next)) break - effects.push(next) - i++ + if (!isConvolution(child)) { + let next: unknown = null + while ((next = children[i + 1]) instanceof Effect) { + if (isConvolution(next)) break + effects.push(next) + i++ + } } const pass = new EffectPass(camera, ...effects)