Skip to content

Commit 9d3b9e0

Browse files
fix(EffectComposer): don't merge convolution effects (#242)
1 parent 1656c9c commit 9d3b9e0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/EffectComposer.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
DepthDownsamplingPass,
2020
Effect,
2121
Pass,
22+
EffectAttribute,
2223
} from 'postprocessing'
2324
import { isWebGL2Available } from 'three-stdlib'
2425

@@ -136,7 +137,13 @@ export const EffectComposer = React.memo(
136137

137138
if (child instanceof Effect) {
138139
const effects: Effect[] = []
139-
while (children[i] instanceof Effect) effects.push(children[i++] as Effect)
140+
while (
141+
// Filter to effects
142+
children[i] instanceof Effect &&
143+
// Don't merge convolution effects
144+
((children[i] as Effect).getAttributes() & EffectAttribute.CONVOLUTION) !== 0
145+
)
146+
effects.push(children[i++] as Effect)
140147
i--
141148

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

0 commit comments

Comments
 (0)