Skip to content

Commit

Permalink
fix(EffectComposer): don't skip effects when backtracking (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Oct 24, 2023
1 parent 1f4c6c8 commit 41ffe02
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/EffectComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,12 @@ export const EffectComposer = React.memo(

if (child instanceof Effect) {
const effects: Effect[] = [child]
while (children[i] instanceof Effect && !isConvolution(children[i] as Effect)) {
effects.push(children[i++] as Effect)

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)
Expand Down

0 comments on commit 41ffe02

Please sign in to comment.