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

Scene View - RenderingPath.DeferredLighting

Discussion in 'Scripting' started by CFprime, Jul 30, 2015.

  1. CFprime

    CFprime

    Joined:
    Feb 6, 2015
    Posts:
    27
    Unity 4.x

    I'm trying to get the Scene View to stick with Deferred rendering. If I create a new project set the player to deferred lighting everything looks great. Deferred in both the Game View and Scene View.

    Unfortunately, at some point Unity decides to revert the Scene View to Forward rendering and I can't figure out what is causing it, nor can I get it to switch back.

    The following should work and will return that the render path is Deferred, but the actualRenderingPath is Forward.

    Code (CSharp):
    1.         Camera view = (SceneView.currentDrawingSceneView).camera;
    2.         if (view != null) {
    3.             view.renderingPath = RenderingPath.DeferredLighting;
    4.             Debug.Log(view.renderingPath);
    5.             Debug.Log(view.actualRenderingPath);
    6.         }  else
    7.             Debug.Log("Nope");
    8.  
    Suggestions welcome...
     
  2. CFprime

    CFprime

    Joined:
    Feb 6, 2015
    Posts:
    27
    I found what is controlling which rendering path the View uses.

    It turns out that the Perspective view will show Deferred if enabled by the player. Switching to Ortho forces it back to Forward rendering no matter what.