Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Camera.Render()?

Discussion in 'General Graphics' started by baby_jeans, Nov 27, 2015.

  1. baby_jeans

    baby_jeans

    Joined:
    Sep 1, 2015
    Posts:
    34
    I was curious if Camera.Render() is supposed to render to the screen when there is a null target texture. I've got a scene with 3 Cameras, each at a different depth. One for my "background", the main scene one, and a third for the UI.

    At first, I left background and UI cameras enabled and let them just render, and called mainSceneCam.Render() in a LateUpdate on a script. I assumed it was actually getting cleared by the background camera and that's why I didn't see it. When I disabled the other two cameras, I just got the "Scene is Missing a FullScreen Camera" scene in game, but my debug logs were getting hit in the OnPreCull, OnRenderImage / etc Functions. I tried just blitting the src to dst in on Render image, but no dice.

    The only way I could see it is if Rendered the mainSceneCam to a Texture first.

    Is that intended? I was hoping to be able to Render directly to screen. Then I could disable all 3 and call render on them in order - which I tried to no avail.
     
  2. baby_jeans

    baby_jeans

    Joined:
    Sep 1, 2015
    Posts:
    34
    Giving this a bump - with more experimenting, I'm pretty sure Camera.Render() doesn't render to the screen with a null texture, but since it's undocumented I wanted to make sure I'm just not missing something.