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.

Unity is confusing scene view camera with game view camera (Case 1109127)

Discussion in '2018.3 Beta' started by bitinn, Dec 13, 2018.

  1. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    953
    (This is a cross-post from LWRP thread, I believe this is a bug in Unity core, but can't say for sure, would love to see someone confirm this bug is known and being worked on for 2018.3 releases...)

    Hi, I am reporting yet another issue with LWRP that I believe is actually caused by Unity core bug, but since it's pretty prevalent and I haven't found an open issue for it, I decide to report here as well:

    First check this short clip:


    What happened? Well, when implementing a Scriptable Render Pass, IBeforeCameraRender's ExecuteBeforeCameraRender will pass a camera object that is supposed to be the main camera of game view for rendering.

    Problem is, it wasn't the main camera of game view, it was the main camera from scene view! (And it doesn't always happen, entering play mode or toggling scene view effect can trigger it, at least on macOS with Intel GPU.)

    Just to be sure, I added an extra field and reference the main camera instead, and now game view render correctly (of course, the scene view will then be broken):


    I remember seeing this issue when watching Andy's boat attack demo:


    And I face a similar issue when using an asset store tool involving GPU instancing and LWRP: https://forum.unity.com/threads/released-gpu-instancer.529746/page-12#post-3951187

    I don't know what's going on, so I open a case 1109127, hopefully someone can look into it.

    Many thx.
     
    MadeFromPolygons likes this.