javascriptthree.js8thwall-web

How to add Three.js EffectComposer to 8th Wall


I'm trying to get a three.js postprocessing bloom effect working in 8th Wall but can't seen to get things working right.

I'm loading the EffectComposer in head.html using:

<script src="http://mrdoob.github.com/three.js/examples/js/postprocessing/EffectComposer.js"></script>

Then, in my .js file I get the three.js scene, renderer and camera using

const {scene, camera, renderer} = XR8.Threejs.xrScene()

And construct the EffectComposer like this:

composer = new THREE.EffectComposer(renderer)

After doing so and running the script, it returns the following error:

undefined is not a constructor (evaluating 'new THREE.EffectComposer(renderer)')

Any help would be appreciated!


Solution

  • Fixed the issue by changing the link from: http://mrdoob.github.com/three.js/examples/js/postprocessing/EffectComposer.js to: //cdn.rawgit.com/mrdoob/three.js/r123/examples/js/postprocessing/EffectComposer.js