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 = {
4747 scene ?: THREE . Scene
4848}
4949
50+ const isConvolution = ( effect : Effect ) : boolean =>
51+ ( effect . getAttributes ( ) & EffectAttribute . CONVOLUTION ) === EffectAttribute . CONVOLUTION
52+
5053export const EffectComposer = React . memo (
5154 forwardRef (
5255 (
@@ -136,15 +139,10 @@ export const EffectComposer = React.memo(
136139 const child = children [ i ]
137140
138141 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 ) ) {
146144 effects . push ( children [ i ++ ] as Effect )
147- i --
145+ }
148146
149147 const pass = new EffectPass ( camera , ...effects )
150148 passes . push ( pass )
You can’t perform that action at this time.
0 commit comments