Misalign of orthogonal camera and SSAO post process image when changing frustum

Here is the playground link: Babylon.js Playground

I need to change orthoLeft, orthoRight etc. in my project in order to zoom and pan the camera. What I am missing? Is there a manual align method that I need to call after frustum change?

Second problem: SSAO looks messed up if I apply a negative minZ for the camera.

cc @Cedric

You need to change the values depending on what you want to do. for zooming in:

I’m not sure to understand what you need with the method to call after frustum change. Maybe this will have some interests to you :

Thanks for your answer. I have an iso-3d-SimCity-like scene with “zoom to pointer” functionality like this: https://playground.babylonjs.com/#FCPCCZ#3

Zooming also involves also shifting the frustum. Maybe it is an odd way but it worked for me until I introduced ambient occlusion. From your example I get that uniformly increasing/decreasing the frustum to all extends (center zoom) does work with SSAO. I guess I can implement panning by changing camera.position and use this in combination with uniformed frustum change for the same results…

Any hints regarding the problem with negative camera.minZ? I can’t get good results for SSAO with this values: https://playground.babylonjs.com/#FCPCCZ#5

I have no good explanation for that, sorry. Maybe @sebavan will have some ideas when he gets back from vacation

Any news regarding negative camera.minZ in combination with SSAO? Is it possible to prevent clipping of the ortho cam without negative minZ as a workaround?

Sorry for the delay. Let me add @Evgeni_Popov who knows more than me.

Negative values for minZ are not supported, as minZ corresponds to the distance from the near clipping plane. Only values greater than 0 are supported.

Regarding your issue, this is due to the fact that off-center frusta were not supported in SSAO. This PR will fix it:

2 Likes