N8python / n8ao

An efficient and visually pleasing implementation of SSAO with an emphasis on temporal stability and artist control.
Creative Commons Zero v1.0 Universal
378 stars 14 forks source link

pass.setRenderer is not a function #2

Closed vedrankolac closed 1 year ago

vedrankolac commented 1 year ago

When I instantiate it like this:

const composer = new EffectComposer(renderer);
// N8AOPass replaces RenderPass
const n8aopass = new N8AOPass(
        scene,
        camera,
        width,
        height
    );
composer.addPass(n8aopass);

I get this error:

postprocessing.esm.js:7768 Uncaught TypeError: pass.setRenderer is not a function
    at EffectComposer.addPass (postprocessing.esm.js:7768:10)

I am using this packages:

"three": "^0.152.2",
"postprocessing": "^6.31.0",
vis-prime commented 1 year ago

This lib is not created for the EffectComposer from pmndrs(yet!), instead use inbuilt one in

import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer"

vedrankolac commented 1 year ago

oh... got it! It works now :)

Is there a way to get a result from three/examples/jsm/postprocessing/EffectComposer to pmndrs EffectComposer?

i.e. I am using MotionBlurEffect from realism-effects and would like to have it work together with N8AOPass :)

N8python commented 1 year ago

Support has been added right now! Check the docs under Usage (postprocessing).

vedrankolac commented 1 year ago

Great!! Thanks for the help!!