Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Multiple cameras on mobile

Discussion in 'Shaders' started by Daniel_Brauer, Sep 2, 2013.

  1. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    I'm experimenting with an off-screen rendering setup, where a few cameras render to a RenderTexture before the final image is blitted to the frame buffer. If I don't mark my RenderTexture as expecting a restore, I get warnings all over the place. Now, I understand that it's expensive to never clear the frame buffer, but what is the cost of rendering multiple cameras in a row? Is it just that you could potentially be wasting the TBDR renderer's advantage by forcing opaque geometry to be resolved more than once? Is this still relevant if my first camera renders all opaque geometry, and it's only transparent and effects after that?
     
  2. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    I should also note that even though MarkRestoreExpected() gets rid of the warnings, and the compositing works fine in the desktop player, it appears that on an actual iPhone the buffer is cleared before I write to it, so only the final camera's results are shown.