In this playground i'm using SSAO: http://www.babylonjs-playground.com/#27DV4V
If you click on the canvas, the 2 spheres will be removed from the scene (but not disposed). The problem is that SSAO effect of the spheres remains visible.
I think this line is causing the issue: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/Textures/babylon.renderTargetTexture.ts#L238
getActiveMeshes returns a SmartArray and the internal data array is used directly here wihtout using the real length of the SmartArray.
This also means that the frustum culling is not working correclty for the DepthRenderer at the moment.