Search Issue Tracker

By Design

Votes

0

Found in

2020.3.44f1

2021.3.17f1

2022.2.3f1

2023.1.0a25

Issue ID

UUM-22995

Regression

No

Opaque Geometry rendered behind Skybox before reaching the Far Clipping value

--

-

Steps to reproduce:
1. Open the SampleScene of the attached user's project "T1451496_FarClip.zip"
2. In the scene, the Cube is placed right before the Camera’s Far clipping value
3. Notice that the Cube is not rendered in the Game view
4. Go to Window > Rendering > Lighting > Environment and remove the Skybox from the scene
5. Notice that the Cube is now visible in the Game view
6. Add again the Skybox to the scene

Expected: the Cube is still visible in the Game view
Actual result: the Skybox hides the Cube (see attached SkyboxFarClip.gif)

Reproducible on: 2020.3.44f1, 2021.3.17f1, 2022.2.3f1, 2023.1.0a25

Notes:
-Reproduces in both Built-In and Universal Render Pipelines
-When there isn’t a Skybox in the scene, the opaque object is rendered correctly. However, if a Skybox is added the object is no longer visible (although according to the Frame Debugger it should be)
-This issue occurs when the Camera’s Clear Flags are set to Skybox and there is a Skybox assigned in the Lighting window. It happens when the Camera is set to Perspective and does not occur when it’s in Orthographic
-If the Material assigned to the object is Transparent or has a render queue set to 2501 or above, the object is rendered correctly, so the issue is only visible with opaque objects

  1. Resolution Note:

    This is by design.
    Context:
    - Skybox is rendered after opaque (common practice to avoid overdraw on skybox pixels where it will be occluded by opaque)
    - Skybox is rendered using an 'infinite projection matrix' at almost z=1 but needs to be slightly nudged to to floating point precision (see https://terathon.com/gdc07_lengyel.pdf for very in depth details)
    - Transparencies do not have this problem as they are rendered after the skybox (since they need to possibly blend on-top of the skybox)
    TLDR; This works as intended for performance/floating point precision reasons. It's been like this for a very long time.

    Application specific mitigation should be feasible:
    - Nudging near-plane/far-plane/cube position may work around precision issues
    - Don't rely on object close to far plane (e.g. fog to fade them out)
    - Make them tranparencies with alpha=1
    ...

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.