Closed csf30816 closed 4 years ago
Hi, this is nothing to do with noa, it has to do with Babylon's move to ES6 modules (for the sake of tree shaking).
The short answer is you need to import a babylon component that enables the feature you want, and then (asynchronously afterwards) set up noa, which creates the babylon scene, and then you can set up DOF
import('@babylonjs/core/Rendering/depthRendererSceneComponent').then(() => {
// initialize noa
var scene = noa.rendering.getScene()
// set up DOF
})
You're probably thinking "wait how do I know which Babylon library I need to import for which feature?" and the answer is, I don't know, I found the answer this BJS forum post. Probably Babylon needs better error messages for stuff like this.
Ah, thank you. I had some errors with tree shaking earlier that I resolved. I just didn't think this was the same problem. Thanks!
As for finding the right module I just search in the BJS GitHub repo for files.
when trying to add DoF using the
DefaultRenderingPipeline
I get that error.