ifc

OpenBim Components PostProductionRenderer fails on _n8ao


I was following the instructions on how to add PostProductionRenderer to my BIM app as described in here

Using this code snippet:

const guiAO = gui.addFolder("SAO");
const configuration = postproduction._n8ao.configuration;
guiAO.add(postproduction.settings, "ao")
 .name("Ambient occlusion")
.onChange((value) => {
postproduction.setPasses({ ao: value });

I get the following error:

Property '_n8ao' is private and only accessible within class 'Postproduction'.ts(2341)

How can I overcome this?

Thanks!


Solution

  • I could agree that the documentation has some stale data. Happen same to me with the implementation of fragmenthighlighter.

    For your case you should do the following change before:

    const configuration = postproduction._n8ao.configuration;
    

    after

    const configuration = postproduction.n8ao.configuration;