SSAO only works when the inspector is active

Hello Forum,

I am adding SSAO/SSAO2 to my project, but somehow I only receive results when also activating the Babylon Inspector. If the Inspector is not active, I get different error messages depending on if I am using SSAO or SSAO2. The same code runs in my playgrounds without any issues. But as soon as I implement the effect in my Larger Project, I run into problems. Only when I also implement the Babylon Inspector does the code run without errors, and the SSAO effect is displayed exactly as I defined it. I am aware that this is not much information to work with, but I thought maybe someone might know why this is happening.

With SSAO I get: scene.enableDepthRenderer is not a function
With SSAO2 I get: scene.enablePrePassRenderer is not a function

Thank you for your time and have a great day

I guess you are using the babylon es6 version and you are missing side effects.

here it looks like you are missing:

import “@babylonjs/core/Rendering/depthRendererSceneComponent”;
import “@babylonjs/core/Rendering/prePassRendererSceneComponent”;


Thank you, thats it! :slight_smile: