Search Issue Tracker
By Design
Votes
0
Found in
2020.3.37f1
2021.3.7f1
2022.1.11f1
2022.2.0b3
2023.1.0a4
Issue ID
UUM-10250
Regression
No
Canvas visibility is inconsistent depending on the Camera's Clipping Plane Far or Near values when the Canvas.planeDistance is set to Camera.farClipPlane or Camera.nearClipPlane
Reproduction steps:
- Open the attached project
- Open the “/Assets/Scenes/SampleScene.unity“ Scene
- Enter the Play Mode
- Select the “Main Camera” GameObject in the Hierarchy window
- Adjust the Far Clipping Plane value in the Inspector window
- Observe the “Canvas” GameObject behavior in the Game View
Expected result: The “Canvas” GameObject is always visible
Actual result: The “Canvas” GameObject is visible/invisible depending on the Far Clipping Plane value
Reproducible with: 2020.3.37f1. 2021.3.7f1, 2022.1.11f1, 2022.2.0b3, 2023.1.0a4
Reproducible on: Windows 10 (21H2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Resolution Note:
Here's my take on the bug:
The Canvas Distance script executes this line of code `canvas.planeDistance = cam.farClipPlane;`.
In this case, I find it pretty unsurprising that the canvas flickers. It looks to me like a simple case of floating point equalities. Why not have something like `canvas.planeDistance = cam.farClipPlane - EPSILON;`, where the epsilon value is large enough avoid issues?
TLDR: I think the canvas is being frustum-culled because it is positioned right at the far plane. If you bring it a tiny bit closer, it won't flicker.