GizmoManager and SSAORenderingPipeline, It does the SSAO twice in a frame

Description

I’m trying using GizmoManager along with SSAORenderingPipeline.
When I see Nsight or SpectorJS, it seems it’s processing SSAO twice in a single frame.

More in general, I think a thing called UtilityLayer does not work well with RenderingPipeline.

How do I fix this?

Demo

Environment

  • OS: Windows 10
  • Browser: Chrome 98
  • Babylon: 4.2.1 but the demo above also is reproducing the behavior in 5.0.0-beta
2 Likes

Hi and welcome. Your web audio and rendering stuff is awesome:) . Maybe @Evgeni_Popov can give you some insight

Forcing the geometry buffer (5th parameter of the SSAO2RenderingPipeline constructor) does reduce the number of rendering to the same number than when the gizmo is not used. So it seems it’s related to the prepass renderer: pinging @CraigFeldspar in case he has an idea.

@CraigFeldspar any updates on this one ?

Actually, SSAO is bound on a camera, which is the same used on the utilityLayer. So when it calls scene.render, the SSAO is also rendered as it’s in the list of the camera’s postprocesses.
I’m proposing this PR that deactivates all post processes on the utility layer scene, but I don’t know if it’s the way to go. Pinging @sebavan for more insight

1 Like

I kind of like it @Deltakosh what do you think ?

I totally support the idea :smiley:

ohhh, so it seems simply saying utilityLayer.utilityLayerScene.postProcessesEnabled would be enough for my case. Thank you for the code!

2 Likes