Fix #90641: wireframe does not hide edges of coplanar faces #105352

Merged
Germano Cavalcante merged 1 commits from mano-wii/blender:drw_edges_factor_new into main 2023-04-03 16:22:51 +02:00

Use the polygons connected to the edge to calculate the edge factor.

This also fixes #102545 as it ensures more predictable results for
boundary and non-manifold edges.


The current way of calculating the edges factor is confusing and can bring unpredictable results.

This happens because:

  • detection of manifold edges is partially incorrect as it uses the poly corner count per edge but the factor is only and always added to the corners when the corner count is 2;
  • As the detection of manifold edges occurs during poly corner counting, the first corner of an edge is never considered manifold;
  • The algorithm used to calculate the edges factor depends on the normal of the vertices, but the normal of the connected polygons would be the most expected (See Auto Smooth);

So the proposed solution is to use the polygons connected to edge to calculate the edge factor.

This matches the current way of detecting edges for Auto Smooth.

Preliminary performance tests show an even better result than the previous algorithm (34 vs 35 FPS).

(Multithreading can be worked on later).

Use the polygons connected to the edge to calculate the edge factor. This also fixes #102545 as it ensures more predictable results for boundary and non-manifold edges. --- The current way of calculating the edges factor is confusing and can bring unpredictable results. This happens because: - detection of manifold edges is partially incorrect as it uses the poly corner count per edge but the factor is only and always added to the corners when the corner count is 2; - As the detection of manifold edges occurs during poly corner counting, the first corner of an edge is never considered manifold; - The algorithm used to calculate the edges factor depends on the normal of the vertices, but the normal of the connected polygons would be the most expected (See `Auto Smooth`); So the proposed solution is to use the polygons connected to edge to calculate the edge factor. This matches the current way of detecting edges for `Auto Smooth`. Preliminary performance tests show an even better result than the previous algorithm (34 vs 35 FPS). (Multithreading can be worked on later).
Germano Cavalcante added the
Module
User Interface
Interest
EEVEE & Viewport
labels 2023-03-01 22:35:37 +01:00
Germano Cavalcante force-pushed drw_edges_factor_new from d0bd50f0fd to 982990cfdc 2023-03-02 00:56:36 +01:00 Compare
Germano Cavalcante requested review from Clément Foucault 2023-03-02 00:57:37 +01:00
Germano Cavalcante changed title from DRW: new method to calculate edges factor to [WIP]DRW: use face normals to calculate edge factor 2023-03-03 14:10:53 +01:00
Hans Goudey changed title from [WIP]DRW: use face normals to calculate edge factor to WIP: DRW: use face normals to calculate edge factor 2023-03-03 21:48:59 +01:00
Germano Cavalcante force-pushed drw_edges_factor_new from fb90c4c6d5 to ad53691f21 2023-03-03 22:13:42 +01:00 Compare
Germano Cavalcante changed title from WIP: DRW: use face normals to calculate edge factor to Fix #90641: wireframe does not hide edges of coplanar faces 2023-03-03 22:14:28 +01:00
Germano Cavalcante force-pushed drw_edges_factor_new from ad53691f21 to 1e4398aa88 2023-03-04 00:27:47 +01:00 Compare
Germano Cavalcante force-pushed drw_edges_factor_new from 1e4398aa88 to 83d0062086 2023-03-04 02:39:31 +01:00 Compare
Germano Cavalcante force-pushed drw_edges_factor_new from 83d0062086 to 9e0b1c1392 2023-03-08 16:12:48 +01:00 Compare
Germano Cavalcante added
Module
EEVEE & Viewport
and removed
Module
User Interface
Interest
EEVEE & Viewport
labels 2023-03-08 16:34:46 +01:00
First-time contributor

Hi @mano-wii
Any plans to merge this to master in the near future?
This helps a lot the readability of dense models in object mode (when wireframe overlay is on).
Thanks!

Hi @mano-wii Any plans to merge this to master in the near future? This helps a lot the readability of dense models in object mode (when wireframe overlay is on). Thanks!
Clément Foucault approved these changes 2023-03-30 21:42:55 +02:00
Author
Member

Hi @mano-wii
Any plans to merge this to master in the near future?
This helps a lot the readability of dense models in object mode (when wireframe overlay is on).
Thanks!

Thanks for the reminder, @leandro_cavalheiro!
We will proceed with merging this patch to the main branch.

> Hi @mano-wii > Any plans to merge this to master in the near future? > This helps a lot the readability of dense models in object mode (when wireframe overlay is on). > Thanks! Thanks for the reminder, @leandro_cavalheiro! We will proceed with merging this patch to the main branch.
Germano Cavalcante force-pushed drw_edges_factor_new from 9e0b1c1392 to f33c1a7a9b 2023-04-03 16:20:57 +02:00 Compare
Germano Cavalcante merged commit 1380ee74ff into main 2023-04-03 16:22:51 +02:00
Germano Cavalcante deleted branch drw_edges_factor_new 2023-04-03 16:22:54 +02:00
Sign in to join this conversation.
No reviewers
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 project
No Assignees
3 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#105352
No description provided.