Search Unity

Scene View camera erroneously drawing into RenderTexture

Discussion in 'High Definition Render Pipeline' started by Aaron-Meyers, Feb 25, 2020.

  1. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    305
    I've got a camera in my scene that has a RenderTexture assigned to its TargetTexture. This camera is intended to not clear the RenderTexture (Background Type: None) and accumulate frames on its buffer from only one layer.

    However, when I set it up this way, it never works properly because for some reason, the Scene View camera appears to be rendering into it first! I have an object in my scene that uses a material with the render texture assigned to it so I can see the contents in my scene. The objects from my specified layer draw into the render texture, but only after the Scene View has inexplicably drawn into it, so as I tumbled the Scene View camera around, I can see the background content of my Render Texture change.

    Is this a bug or am I missing something in my setup to prevent this scene view camera takeover?
     
  2. iSpiegelball

    iSpiegelball

    Joined:
    Jan 7, 2020
    Posts:
    14
    Aaron-Meyers likes this.
  3. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    305
    In a build, the same thing is happening except instead of the scene view camera, its my VR rig's camera that appears to be drawing into the RenderTexture. Seems like RenderTextures in HDRP cannot be relied on to only be drawn to the way you have them configured.

    Anyone from Unity care to comment on this? Known bug?
     
  4. iSpiegelball

    iSpiegelball

    Joined:
    Jan 7, 2020
    Posts:
    14
    I am seeing the same behaviour in my project now too.
     
  5. grahamwell

    grahamwell

    Joined:
    Oct 5, 2013
    Posts:
    6
    Me too. I've submitted a bug report.
     
  6. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    305
    this issue is plaguing me again. can anyone from Unity comment?

    @grahamwell can you share a link to your bug report?
     
  7. Leniaal

    Leniaal

    Joined:
    Nov 7, 2012
    Posts:
    119
  8. VardenEE

    VardenEE

    Joined:
    Jul 23, 2019
    Posts:
    13
    Three years later and I have the same issue. Did someone other than Unity find a fix or workaround when using multiple cameras?
     
  9. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    Errors like this can occur if you docks your game and scene side by side.

    Typically it's only an error in that editor state.