Fix: Display nodelinks consistently across different UI scales #111270

Merged
Leon Schittek merged 3 commits from lone_noel/blender:nodelink-consistent-scale into main 2023-08-22 19:24:16 +02:00
Member

Adjust the width, dash length and amount of anti-aliasing of node links
so they look the same independent of the UI scaling.

Adding another parameter to the shader exceeded the limit of 16
attributes. Therefore the parameters to describe the dashes (length,
factor, alpha) are passed in together as a vector.


Issue

On high-dpi displays (e.g. mac retina screens) the node links can look
blurry and the dashes become too narrow. Reported here #102919

The issues are shown in the bottom left image in the comparison tables.

Comparison

The main thing to notice is how for a Resolution Scale of 1.0 the links
look almost identical, except maybe a little crisper.
For larger Resolution scales the PR prevents the described issues and
keeps the look of the links consistent.

Large Zoom
Resolution Scale Main Pull Request
1.0
4.0
Small Zoom
Resolution Scale Main Pull Request
1.0
4.0
Small Resolution Scale

Currently using a small resolution scale causes aliasing along the
edges of node links.

Resolution Scale Pull Request Main
0.2 patch_1080p_020_big.png main_1080p_020_big.png
Adjust the width, dash length and amount of anti-aliasing of node links so they look the same independent of the UI scaling. Adding another parameter to the shader exceeded the limit of 16 attributes. Therefore the parameters to describe the dashes (length, factor, alpha) are passed in together as a vector. --- #### Issue On high-dpi displays (e.g. mac retina screens) the node links can look blurry and the dashes become too narrow. Reported here #102919 *The issues are shown in the bottom left image in the comparison tables.* #### Comparison The main thing to notice is how for a Resolution Scale of 1.0 the links look almost identical, except maybe a little crisper. For larger Resolution scales the PR prevents the described issues and keeps the look of the links consistent. ##### Large Zoom |Resolution Scale|Main|Pull Request| |---|---|---| |1.0|![](https://projects.blender.org/attachments/ac6616f1-5843-4970-8cb6-df93a93e94aa)|![](https://projects.blender.org/attachments/38148ed1-dc2a-4aad-b817-7d3bf9e04171)| |4.0|![](https://projects.blender.org/attachments/e46f9442-d44f-405b-bf42-f8149a5b2d5c)|![](https://projects.blender.org/attachments/50f93da0-4876-45ba-84a0-7bc7bf1d236a)| ##### Small Zoom |Resolution Scale|Main|Pull Request| |---|---|---| |1.0|![](https://projects.blender.org/attachments/bdf3ceef-c06d-440c-99cc-508846b34eab)|![](https://projects.blender.org/attachments/440d1a61-12ee-45ca-bf67-d98c5d5b1888)| |4.0|![](https://projects.blender.org/attachments/39955755-a9f1-4ba7-baae-1181fd2b07fa)|![](https://projects.blender.org/attachments/1aa652a3-f637-40ec-9b02-5387081f09e3)| ##### Small Resolution Scale Currently using a small resolution scale causes aliasing along the edges of node links. |Resolution Scale|Pull Request|Main| |---|---|---| |0.2|![patch_1080p_020_big.png](/attachments/cd8a26bd-4776-48d3-bfbd-df438776bb97)|![main_1080p_020_big.png](/attachments/d6946bf6-1320-4f08-b765-2a1af99ed645)|
Leon Schittek added 1 commit 2023-08-18 16:39:53 +02:00
4d3a6d2218 Fix: Display nodelinks consistently across different UI scales
Adjust the width, dash length and amount of anti-aliasing of node links
so they look the same independent of the UI scaling.
Leon Schittek added this to the User Interface project 2023-08-18 16:40:25 +02:00
Leon Schittek added the
Interest
Geometry Nodes
Interest
Nodes & Physics
labels 2023-08-18 16:40:49 +02:00
Hans Goudey approved these changes 2023-08-19 23:04:27 +02:00
Hans Goudey left a comment
Member

The changes look reasonable, and clearly you've done thorough testing based on the PR description. Thanks!

The changes look reasonable, and clearly you've done thorough testing based on the PR description. Thanks!
@ -47,3 +48,2 @@
.vertex_in(12, Type::FLOAT, "thickness")
.vertex_in(13, Type::FLOAT, "dash_factor")
.vertex_in(14, Type::FLOAT, "dash_alpha")
.vertex_in(13, Type::VEC3, "dash_params")
Member

I guess this is working around a limitation of the number of vertex inputs? Might be nice to mention that in the commit message.

I guess this is working around a limitation of the number of vertex inputs? Might be nice to mention that in the commit message.
Author
Member

Yeah, exactly. Added that to the commit message!

Yeah, exactly. Added that to the commit message!
lone_noel marked this conversation as resolved
Leon Schittek added 2 commits 2023-08-21 21:46:43 +02:00
Author
Member

When going over this again, I noticed that it's cleaner to also move the LINK_WIDTH from the expandSize to the thickness parameter. It was odd how there were two parameters controlling the width of the link...

So the expandSize simply becomes the aspect which is only really used to undo the scaling of the view.

This also allowed for a small improvement to the anti-aliasing of the dashes. Before the size of the smoothing was in view space creating some aliasing when zoomed out.
It also means both the link and the dashes can use the sane ANTIALIAS constant in the fragment shader, which is nice.

Comparison
Here it's noticable how the dashes caused some aliasing when zoomed out.

Main Updated Pull Request
main_10_zoomed-out.png pr_10_zoomed-out.png
When going over this again, I noticed that it's cleaner to also move the `LINK_WIDTH` from the `expandSize` to the `thickness` parameter. It was odd how there were two parameters controlling the width of the link... So the `expandSize` simply becomes the `aspect` which is only really used to undo the scaling of the view. This also allowed for a small improvement to the anti-aliasing of the dashes. Before the size of the smoothing was in view space creating some aliasing when zoomed out. It also means both the link and the dashes can use the sane `ANTIALIAS` constant in the fragment shader, which is nice. **Comparison** Here it's noticable how the dashes caused some aliasing when zoomed out. |Main|Updated Pull Request| |---|---| |![main_10_zoomed-out.png](/attachments/c0bfaa32-1567-49e7-8d45-3ba53aae8820)|![pr_10_zoomed-out.png](/attachments/8c8dc40d-0b1b-45a8-9321-cba9a708c2ef)|
Leon Schittek merged commit 899d723da8 into main 2023-08-22 19:24:16 +02:00
Leon Schittek deleted branch nodelink-consistent-scale 2023-08-22 19:24:17 +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
2 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#111270
No description provided.