Search Unity

Image Effect on Camera distorts output RenderTexture

Discussion in 'AR/VR (XR) Discussion' started by arnebp, Nov 20, 2015.

  1. arnebp

    arnebp

    Joined:
    Oct 15, 2013
    Posts:
    22
    I am experiencing a strange issue. Using Oculus DK2 in Unity 5.2.3 & Oculus Unity pack 0.1.3.

    I have set up a scene that renders segmented parts of the scene in high detail via viewport clipping. I am doing this using 2 cameras. One camera renders the full scene in low detail and another renders a segmented part of the viewport in high detail. The 2 RenderTextures of the cameras are finally combined using a 'combine depth' shader.



    I want to be able to add image effects on the high detail camera.

    When I do NOT have an image effect on the high detail camera, the output RenderTexture looks like below (see bottom right floating box). Note that the black around the blue center area is the part that is 'clipped away' by the modified viewport.



    When I DO have an image effect on the high details camera, the output RenderTexture looks like so (see bottom right floating box):



    So it seems that using image effects on a Camera with modified ViewPort that renders to a off screen RenderTexture produces an output where the area within the modified viewport is stretched to fill up the entire RenderTexture.

    So question is why this is happening?
    Is there any way to ensure that the output in these 2 modes is consistent?
    Is there any way to customize how a Camera output is rendered to Rendertexure?

    You can download the project here. Press 'zero' to switch cameras.

    EDIT:
    This only happens when using forward rendering path. Using deferred will do the stretch effect with or without an Image Effect
     
    Last edited: Jan 19, 2016
  2. arnebp

    arnebp

    Joined:
    Oct 15, 2013
    Posts:
    22
    Bump!...anyone?