Hi,
it seems something strange is going on if u use the Deferred Renderer (Pro Version) and have multiple cameras setup with Post/Image effects.
As example UFPS uses the default FPS camera setup, which means having everything, except the weapon model in the main scene and overlay this with just a camera that renders the weapon model on top. This helps with z-fighting, since u can finetune the near-plane per camera. It also solves the problem of bigger weapon models clipping through near walls/objects.
The problem is that all image effects are broken for those setups and the Deferred Renderer. Don’t get confused by UFPS inspector camera values, those will be correctly overridden per script on play.
So the main camera correctly has camera.depth set to 0, while the weapon is set to 1, so the render order is ensured, also the weapon camera is set correctly to only clear-z. The main camera also correctly renders everything except weapons and the local player, while the weapon camera only renders the weapon.
So any image based effect that is attached to the main camera should correctly process only this camera/rendertarget inside OnRenderImage(), while the weapon camera should have no impact at all, if no image effect is attached to it.
What happens is, as if the “OnRenderImage()” function inside the SSAO script on the main camera, gets the final render result including all cameras, therefor the z-values are already cleared by the weapon camera and SSAO cant work.
The correct way would be to call and process OnRenderImage() per camera, not after all cameras are rendered. I suspect this is some kind of bug and not the general behavior of the Deferred Renderer, since each camera should always be processed in order and separately, since otherwise it would be impossible to have different image effects per camera.
so @Unity whats going on here?
thx Andy