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
- "ShaderGraph" misses a space in the "Project Settings" section
- UI Builder inspector’s checkbox fields can be activated when clicking anywhere in the value field
- Unity icon is poorly visible in the "Build Profiles" window when "Dark" editor theme is selected
- UI Toolkit Transition Animation is ignored when background-size property has a starting value of 0
- Error "Assertion failed on expression: 'i->previewArtifactID == found->second.previewArtifactID'" is present when creating Render Texture
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.