Skip to content

Commit 41ffe02

Browse files
fix(EffectComposer): don't skip effects when backtracking (#248)
1 parent 1f4c6c8 commit 41ffe02

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/EffectComposer.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,12 @@ export const EffectComposer = React.memo(
140140

141141
if (child instanceof Effect) {
142142
const effects: Effect[] = [child]
143-
while (children[i] instanceof Effect && !isConvolution(children[i] as Effect)) {
144-
effects.push(children[i++] as Effect)
143+
144+
let next: unknown = null
145+
while ((next = children[i + 1]) instanceof Effect) {
146+
if (isConvolution(next)) break
147+
effects.push(next)
148+
i++
145149
}
146150

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

0 commit comments

Comments
 (0)