File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ export type EffectComposerProps = {
47
47
scene ?: THREE . Scene
48
48
}
49
49
50
+ const isConvolution = ( effect : Effect ) : boolean =>
51
+ ( effect . getAttributes ( ) & EffectAttribute . CONVOLUTION ) === EffectAttribute . CONVOLUTION
52
+
50
53
export const EffectComposer = React . memo (
51
54
forwardRef (
52
55
(
@@ -136,15 +139,10 @@ export const EffectComposer = React.memo(
136
139
const child = children [ i ]
137
140
138
141
if ( child instanceof Effect ) {
139
- const effects : 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
- )
142
+ const effects : Effect [ ] = [ child ]
143
+ while ( children [ i ] instanceof Effect && ! isConvolution ( children [ i ] as Effect ) ) {
146
144
effects . push ( children [ i ++ ] as Effect )
147
- i --
145
+ }
148
146
149
147
const pass = new EffectPass ( camera , ...effects )
150
148
passes . push ( pass )
You can’t perform that action at this time.
0 commit comments