Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I'm implementing OutlinePass on my project, with EffectComposer, FXAAShader, CopyShader and ShaderPass included. I've followed the steps in the example, yet these 2 errors appeared and the whole scene was pitch black. I have no idea how to fix them since they all pointed to the included OutlinePass library. Any one has any idea of how to fix these? Thanks a lot!
- Errors:
- > Uncaught TypeError: Cannot read property 'prototype' of undefined
- at OutlinePass.js:131
- > Uncaught TypeError: this.getPrepareMaskMaterial is not a function
- at new THREE.OutlinePass (OutlinePass.js:45)
- at init (script.js:89)
- at script.js:219
- Here is the code:
- var OUTLINE;
- var COMPOSER;
- var FXAA;
- function init() {
- scene.add(controls.getObject());
- COMPOSER = new THREE.EffectComposer(renderer);
- var renderPass = new THREE.RenderPass(scene, camera);
- COMPOSER.addPass(renderPass);
- FXAA = new THREE.ShaderPass(THREE.FXAAShader);
- FXAA.uniforms['resolution'].value.set(1 / window.innerWidth, 1 / window.innerHeight);
- FXAA.renderToScreen = true;
- COMPOSER.addPass(FXAA);
- OUTLINE = new THREE.OutlinePass(new THREE.Vector2(window.innerWidth, window.innerHeight), scene, camera);
- OUTLINE.edgeStrength = 6;
- OUTLINE.edgeGlow = 1;
- OUTLINE.edgeThickness = 4;
- OUTLINE.pulsePeriod = 2;
- OUTLINE.visibleEdgeColor = 0xffff00;
- OUTLINE.hiddenEdgeColor = 0xffffff;
- COMPOSER.addPass(OUTLINE);
- }
- function animate() {
- requestAnimationFrame(animate);
- COMPOSER.render();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement