SSR post process disposing issue

Hi!

I have a problem. When I try to get rid of the post-processing SSR, the textures that serve the SSR are not removed.

You can see it on this PG:
https://playground.babylonjs.com/#PIZ1GK#269

When 48-th string is false we have only 4 textures (skyBox, Fire, ground-2x)
When 48-th string is true and we delete SSR after it’s creation we have 14 textures.

And i find small artifact in SSR documentation:

Adding @julien-moreau the SSR daddy to double check the dispose :slight_smile:

The doc has been fixed and will be in the next nightly

1 Like

Hey @simon I’m having a look ASAP !
Can you confirm that if you write “scene.disableGeometryBufferRenderer()” (something like then) then you don’t have the extra textures anymore ? The SSR post-process enables the geometry buffer renderer that provides the necessary informations to compute reflections

2 Likes

When I used this function, the number of textures in the scene was 12 instead of 14. G-buffer and gBuffer_prePassRTT were removed.

Hi checked with the prepass renderer as well and I don’t return to 4 textures in memory.
@sebavan, the SSR post-process doesn’t implement the dispose function, it let’s the PostProcess class doing the dispose (because I have nothing to dispose ahah). Do you think that the problem can come from the prepass renderer or geometry buffer renderer? I reproduce exactly the same problem with motion blur post-process and SSAO2 rendering pipeline: https://playground.babylonjs.com/#20OAV9#4762 (see the alerts showing the textures count)

@CraigFeldspar would you mind having a quick look ?

MultiRenderTarget didn’t properly release the Texture wrapper around the InternalTexture. No memory leak on the GPU, but empty wrappers stayed in scene.textures.

Be careful though, when you enable SSAO2 then dispose it, the prepass will still be active, and the associated PrePassRenderTargets won’t be disposed . It does that to avoid destruction/recreation when rapidly changing the list of effects.

If you really want to clean all of the textures, you have to add scene.disablePrePassRenderer(); like in this PG

2 Likes

Will be up in one hour in the PG, running the nightly as I write.

Is there any way to make the SSR effect not show, rather than delete it?
It is convenient for me to turn on SSR when I want to when I need it.

Would attaching and detaching it from the camera not be sufficient ?