composer.render() has strange dependency on EffectComposer

Description of the problem

When calling composer.render() I get this strange error in the Chrome console. EXCEPTION: TypeError: Right-hand side of 'instanceof' is not an object.

When I swap it out for the WebGLRenderer everything is fine. I log the composer and it is defined and all passes are visible in Chrome Devtools. The Stacktrace points to this line of EffectComposer.js:

if ( pass instanceof THREE.MaskPass ) {

If I am interpreting this correctly, it means I need to also load THREE.MaskPass into my project as a dependency to even use EffectComposer. This seems like an architectural flaw and it also appears to be a circular dependency since THREE.MaskPass depends on THREE.Pass which is found in EffectComposer.js. Indeed, loading THREE.MaskPass I was able to resolve the error.

Three.js version
  • Dev
  • r77
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

1 thought on “composer.render() has strange dependency on EffectComposer

Comments are closed.