Search Unity

Graphics.blit from one camera to another and keep depthbuffer

Discussion in 'Image Effects' started by OlliQueck, Dec 9, 2016.

  1. OlliQueck

    OlliQueck

    Joined:
    Apr 11, 2013
    Posts:
    49
    Hey there, i'm using a script which copy's the main camera and makes it render nothing at all. then it takes the copycam, renders from it's perspective and blits the rendered image to my old camera with better quality(msaa). This works nicely but it doesn't copy the depth buffer. Anyone has a clue what this could be caused by?

    Code from Fallc can be found here https://forum.unity3d.com/threads/b...aces-in-forward-renderer.408645/#post-2808616

    i already added Camera.depthTextureMode but nothing changes. The only way i found to achieve a depth channel was to not disable the second camera after render(), this makes the depthchannel appear in buffer but without the MSAA and with double the draw calls....