Skip to content

Desktop: Fix UI and viewport blending#3052

Merged
timon-schelling merged 6 commits intomasterfrom
desktop-fix-ui-and-viewport-blending
Aug 14, 2025
Merged

Desktop: Fix UI and viewport blending#3052
timon-schelling merged 6 commits intomasterfrom
desktop-fix-ui-and-viewport-blending

Conversation

@timon-schelling
Copy link
Copy Markdown
Member

Closes #3043

@timon-schelling timon-schelling changed the title Desktop fix UI and viewport blending Desktop: Fix UI and viewport blending Aug 13, 2025
@github-actions github-actions Bot temporarily deployed to graphite-dev (Preview) August 13, 2025 13:56 Inactive
@TrueDoctor
Copy link
Copy Markdown
Member

This currently applies srg gamma conversions multiple times. Shouldn't we just create a srgb version of the viewport value and keep the others as is?

@github-actions github-actions Bot temporarily deployed to graphite-dev (Preview) August 13, 2025 21:40 Inactive
@timon-schelling
Copy link
Copy Markdown
Member Author

Sure, found a way of writing that relatively clean.

Sadly this doesn't active the exact result like web. With "fade artwork" at 80% white color artwork results in #4E4E4E in web and #4C4C4C in desktop.

There is also a problem with the dots. Node graph view background dots on .graph:before are not transparent when rendered with hole punch enabled. "mix-blend-mode: screen" doesn't work like in web in that case. Cef returns [34, 34, 34, 255] (alpha always 255) for these dots when fade artwork is 80%.

@timon-schelling
Copy link
Copy Markdown
Member Author

image

@timon-schelling
Copy link
Copy Markdown
Member Author

If I understand the chromium docs correctly it will do blending in the renderer’s working/display color space (not strictly sRGB) with source-over (Porter-Duff).
This PR tries to do the same. Result is not quit the same, slight visual change when disabling vello.

@Keavon
Copy link
Copy Markdown
Member

Keavon commented Aug 13, 2025

You'd mentioned the blend mode on the parts of the graph. That won't be something we have any control over, since blend modes fundamentally have no effect at the bottom of a compositing stack. We'll have to wait for our custom-rendered node graph UI overlay before we can get that to draw similarly, but we can just make it look as decent as possible in the meantime.

@TrueDoctor
Copy link
Copy Markdown
Member

Is this ready for review / merge then?

@timon-schelling timon-schelling marked this pull request as ready for review August 14, 2025 06:52
@timon-schelling
Copy link
Copy Markdown
Member Author

Yes, the issue with the dots should be solved separately, should only concern frontend code.

@github-actions github-actions Bot temporarily deployed to graphite-dev (Preview) August 14, 2025 06:56 Inactive
@github-actions github-actions Bot temporarily deployed to graphite-dev (Preview) August 14, 2025 10:46 Inactive
@timon-schelling
Copy link
Copy Markdown
Member Author

Just noticed that overlays look more like in web when bleeding overlays and viewport in linear and then bleding that result in srgb with the ui.
Also added a early return for the common case were overlays and ui are transparent.

@timon-schelling
Copy link
Copy Markdown
Member Author

@TrueDoctor ready for final review and merge :)

@timon-schelling timon-schelling merged commit 67a7b98 into master Aug 14, 2025
4 checks passed
@timon-schelling timon-schelling deleted the desktop-fix-ui-and-viewport-blending branch August 14, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix UI and viewport blending

3 participants