Skip to content

Commit

Permalink
fix(EffectComposer): don't merge when convolution is head (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Oct 24, 2023
1 parent 41ffe02 commit 4297896
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/EffectComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4297896

Please sign in to comment.