Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

(Case 1199696) 2019.3b11 Physically Based Sky goes black if camera y is below zero

Discussion in '2019.3 Beta' started by alia_0, Nov 20, 2019.

  1. alia_0

    alia_0

    Joined:
    Nov 28, 2012
    Posts:
    17
    Looks like there is some new code that cause the sky to not be rendered if your camera y is below zero. There is some new code in the shader that does this by checking to see if we are within the planet radius and not rendering the sky if so. This doesn't make much sense since even if I am standing below the horizon line I may still be able to see the sky.

    1. Create scene with physically based sky
    2. Move camera below 1 on y axis. Notice that the sky is visible
    Unity_2019-11-19_17-06-47.png
    3. Move camera down by 2 units. Notice how the sky is missing.
    2019-11-19_17-07-02.png
     
    konsic likes this.
  2. alia_0

    alia_0

    Joined:
    Nov 28, 2012
    Posts:
    17
    For anyone else who doesn't want it to vanish you can modify

    Runtime\Sky\PhysicallyBasedSky\PhysicallyBasedSkyRenderer.cs

    line 326

    Code (CSharp):
    1.             bool isPbrSkyActive = r > R; // Disable sky rendering below the ground
    2.  
    and just set that to true.
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    This is by design: https://issuetracker.unity3d.com/product/unity/issues/guid/1199696/

    "Physically Based Sky works by precomputing sky lighting for a range of altitudes. The smallest altitude is 0, which starts at the sea level. Below the sea level, there is no information, so sky rendering is disabled. Make sure your game world is positioned above the sea level."
     
  4. KingRichard_III

    KingRichard_III

    Joined:
    Jan 27, 2019
    Posts:
    1
    Using a floating origin where my main camera is always 0 results in the black sky. May we get a position that we can write to?