Skip to content

Commit 4297896

Browse files
fix(EffectComposer): don't merge when convolution is head (#250)
1 parent 41ffe02 commit 4297896

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/EffectComposer.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,13 @@ export const EffectComposer = React.memo(
141141
if (child instanceof Effect) {
142142
const effects: Effect[] = [child]
143143

144-
let next: unknown = null
145-
while ((next = children[i + 1]) instanceof Effect) {
146-
if (isConvolution(next)) break
147-
effects.push(next)
148-
i++
144+
if (!isConvolution(child)) {
145+
let next: unknown = null
146+
while ((next = children[i + 1]) instanceof Effect) {
147+
if (isConvolution(next)) break
148+
effects.push(next)
149+
i++
150+
}
149151
}
150152

151153
const pass = new EffectPass(camera, ...effects)

0 commit comments

Comments
 (0)