Metal Viewport: Navigation issue with 'Auto Depth' and 'Wireframe' enabled #107159

Closed
opened 2023-04-20 09:51:26 +02:00 by Ingo Clemens · 8 comments

System Information
Operating system: macOS-13.2.1-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 Max 1.2

Blender Version
Broken: version: 3.5 and 3.5.1 Release Candidate, branch: blender-v3.5-release, commit date: 2023-04-19 10:18, hash: 8e6e737ec80b
Worked: OpenGL backend

Short description of error
Viewport navigation is unreliable at times (panning, zooming and orbiting) when 'Auto Depth' is enabled in the Navigation Preferences and Wireframe is enabled (either in Wireframe display and Wireframe Overlay).

Unreliable means:

  • Orbiting doesn't occur at the mouse position but around an arbitrary point making exact navigation impossible.
  • Panning and Zooming is happening in very small, almost invisible increments.

See this video for a visual reference: https://youtu.be/qqJkxJTSX4s

It doesn't happen all the time and depends on the display size of the objects on screen. The closer the view is to the object, the less frequent the issue occurs.
When the view is from a distance, therefore the objects are displayed small, the error occurs more frequently.

It appears to be a precision error of some sort. Maybe also how fast the interaction is. When there is a noticeable time between the click and the drag it seems to happen less often.

Disabling the Wireframe display fixes the issue.

Exact steps for others to reproduce the error
The problem occurs with default Blender.

  1. Enable 'Auto Depth' in the Navigation Preferences.
  2. Choose Wireframe as the viewport display or turn on the wireframe overlay in the viewport shading settings.
  3. Create some geometry (i.e. spheres which have some more wireframe to display)
  4. Perform regular navigation (pan, orbit, zoom) while trying to navigate around the objects. The issue happens more often the smaller the objects are displayed.
**System Information** Operating system: macOS-13.2.1-arm64-arm-64bit 64 Bits Graphics card: Metal API Apple M1 Max 1.2 **Blender Version** Broken: version: 3.5 and 3.5.1 Release Candidate, branch: blender-v3.5-release, commit date: 2023-04-19 10:18, hash: `8e6e737ec80b` Worked: OpenGL backend **Short description of error** Viewport navigation is unreliable at times (panning, zooming and orbiting) when 'Auto Depth' is enabled in the Navigation Preferences and Wireframe is enabled (either in Wireframe display and Wireframe Overlay). Unreliable means: - Orbiting doesn't occur at the mouse position but around an arbitrary point making exact navigation impossible. - Panning and Zooming is happening in very small, almost invisible increments. See this video for a visual reference: https://youtu.be/qqJkxJTSX4s It doesn't happen all the time and depends on the display size of the objects on screen. The closer the view is to the object, the less frequent the issue occurs. When the view is from a distance, therefore the objects are displayed small, the error occurs more frequently. It appears to be a precision error of some sort. Maybe also how fast the interaction is. When there is a noticeable time between the click and the drag it seems to happen less often. Disabling the Wireframe display fixes the issue. **Exact steps for others to reproduce the error** The problem occurs with default Blender. 1. Enable 'Auto Depth' in the Navigation Preferences. 2. Choose Wireframe as the viewport display or turn on the wireframe overlay in the viewport shading settings. 3. Create some geometry (i.e. spheres which have some more wireframe to display) 4. Perform regular navigation (pan, orbit, zoom) while trying to navigate around the objects. The issue happens more often the smaller the objects are displayed.
Ingo Clemens added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-04-20 09:51:27 +02:00
Author

The problem seems to be limited to macOS. Testing on Windows 10 didn't produce the error.

The problem seems to be limited to macOS. Testing on Windows 10 didn't produce the error.

Thanks for the report, this could possibly be related to other similar selection/texture paint issues where the viewport size state was not always correct for operations outside of rendering passes.

Fixes for these issues have landed in 3.6.0 alpha (https://builder.blender.org/download/daily/) and will be back ported to 3.5.1 but the commits have not yet landed.

would you be able to confirm a few details:

  1. Does this occur with the OpenGL backend enabled in 3.5.0?
  2. Does this occur with the Metal backend in 3.6.0?
  3. Could you please attach the demo file you had in the video? (No worries if you don't have it any more)

Thanks :)!

Though I will investigate this anyhow!

Thanks for the report, this could possibly be related to other similar selection/texture paint issues where the viewport size state was not always correct for operations outside of rendering passes. Fixes for these issues have landed in 3.6.0 alpha (https://builder.blender.org/download/daily/) and will be back ported to 3.5.1 but the commits have not yet landed. would you be able to confirm a few details: 1) Does this occur with the OpenGL backend enabled in 3.5.0? 2) Does this occur with the Metal backend in 3.6.0? 3) Could you please attach the demo file you had in the video? (No worries if you don't have it any more) Thanks :)! Though I will investigate this anyhow!
Jason Fielder added the
Interest
Metal
label 2023-04-20 11:26:28 +02:00
Jason Fielder added this to the EEVEE & Viewport project 2023-04-20 11:26:36 +02:00
Author

Thanks for the quick reply.
How do I check if OpenGL backend is enabled in 3.5.0?
I will check with 3.6.0 and provide a test scene.
Thanks

Thanks for the quick reply. How do I check if OpenGL backend is enabled in 3.5.0? I will check with 3.6.0 and provide a test scene. Thanks
Author

I just tested with the current 3.6.0 Alpha and the issue still exists.

Ok, I found the backend settings in Preferences > GPU Backend
When switching the backend to OpenGL and restarting Blender the issue is gone.
When switching back to Metal and restarting Blender the issue is back.

So, it seems it's a Metal related issue which matches with the result that the issue isn't reproducible on Windows.

Here's the test scene attached. It's important to activate 'Auto Depth' in the preferences.

I just tested with the current 3.6.0 Alpha and the issue still exists. Ok, I found the backend settings in Preferences > GPU Backend When switching the backend to OpenGL and restarting Blender the issue is gone. When switching back to Metal and restarting Blender the issue is back. So, it seems it's a Metal related issue which matches with the result that the issue isn't reproducible on Windows. Here's the test scene attached. It's important to activate 'Auto Depth' in the preferences.
Pratik Borhade added the
Platform
macOS
label 2023-04-20 15:39:19 +02:00
Pratik Borhade changed title from Regression macOS: Navigation issue with 'Auto Depth' and 'Wireframe' enabled to Metal Viewport: Navigation issue with 'Auto Depth' and 'Wireframe' enabled 2023-04-20 15:39:34 +02:00

Can't reproduce with
Operating system: macOS-13.2.1-x86_64-i386-64bit 64 Bits
Graphics card: Metal API AMD Radeon Pro 5700 XT 1.2

Can't reproduce with Operating system: macOS-13.2.1-x86_64-i386-64bit 64 Bits Graphics card: Metal API AMD Radeon Pro 5700 XT 1.2
Author

More testing shows:

Reproducible with MacBook Pro (M1):
Operating system: macOS-13.3-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 Pro 1.2

Correctly working with iMac (Intel):
Operating system: macOS-12.3.1-x86_64-i386-64bit 64 Bits
Graphics card: Metal API AMD Radeon Pro Vega 48 1.2

Which indicates that it's a Metal problem but probably related to M1 machines.

Assuming this is related too: Metal: selection with GPU depth picking is broken in wireframe mode #106742

Because it also mentions the Depth picking (which I assume is the Auto Depth Option in the Preferences).

More testing shows: Reproducible with MacBook Pro (M1): Operating system: macOS-13.3-arm64-arm-64bit 64 Bits Graphics card: Metal API Apple M1 Pro 1.2 Correctly working with iMac (Intel): Operating system: macOS-12.3.1-x86_64-i386-64bit 64 Bits Graphics card: Metal API AMD Radeon Pro Vega 48 1.2 Which indicates that it's a Metal problem but probably related to M1 machines. Assuming this is related too: [Metal: selection with GPU depth picking is broken in wireframe mode #106742](https://projects.blender.org/blender/blender/issues/106742) Because it also mentions the Depth picking (which I assume is the Auto Depth Option in the Preferences).

Have been able to reproduce this, looks like the error occurs when a depth value of zero is read from the depth buffer when it should larger than 0.0, or 1.0 if no object is below the cursor.

My best guess so far is that overlay_wireframe_frag.glsl is specified as outputting manual depth via gl_FragDepth. However, under certain paths, when CUSTOM_DEPTH_BIAS is disabled, this value is not written to, meaning the depth value returned by the wireframe is incorrect.

Though I need to verify this. Will aim to get this bug resolved soon.

Have been able to reproduce this, looks like the error occurs when a depth value of zero is read from the depth buffer when it should larger than 0.0, or 1.0 if no object is below the cursor. My best guess so far is that `overlay_wireframe_frag.glsl` is specified as outputting manual depth via `gl_FragDepth`. However, under certain paths, when CUSTOM_DEPTH_BIAS is disabled, this value is not written to, meaning the depth value returned by the wireframe is incorrect. Though I need to verify this. Will aim to get this bug resolved soon.
Member

Confirming then.

Confirming then.
Pratik Borhade added
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-05-31 07:44:20 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-06-12 08:38:00 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#107159
No description provided.