Skip to content

fix(webgpu): Blend acrylic in Luminosity and Color modes - #26303

Merged
MartinZikmund merged 1 commit into
unoplatform:masterfrom
ramezgerges:dev/rara/webgpu-acrylic-blend-modes
Nov 11, 2026
Merged

MartinZikmund merged 1 commit into
unoplatform:masterfrom
ramezgerges:dev/rara/webgpu-acrylic-blend-modes

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #25357

PR Type:

🐞 Bugfix

What changed? 🚀

With the WebGPU backend, a translucent acrylic over colourful content rendered as a flat, dark grey (most visibly with AcrylicInAppFillColorDefaultBrush in the dark theme, e.g. the DrawingBackends sample in unoplatform/Uno.Samples#966). Skia and WinUI keep the hue of the content behind.

Cause: AcrylicMaterialBrush builds Blend(Blend(Blur(backdrop), luminosity, Luminosity), tint, Color). The WebGPU acrylic composite replaced both blends with plain alpha mixes:

  • the shader did mix(blurred, luminosity, luminosity.a). The dark-theme luminosity colour is 0.96 opaque, so the backdrop's colour was almost entirely replaced by grey;
  • the tint was drawn as a second SrcOver quad over the region.

Fix:

  • The acrylic branch of the image shader now applies the W3C non-separable Luminosity blend (backdrop keeps its hue/saturation, takes the luminosity colour's brightness) and then the Color blend (takes the tint's hue/saturation, keeps the brightness), each weighted by its colour's alpha, as Skia does.
  • The tint rides in the image uniform's m0 slot (only read by the colour-matrix path), so the separate tint quad (DrawBackdropTint) is gone: acrylic is one textured quad after the blur.
  • The lum/clipColor/setLum helpers move out of CompositeBlendWgsl into a shared NonSeparableBlendWgsl snippet, prepended to both modules instead of duplicated.

For a pure red backdrop under the dark-theme acrylic: before ≈ #302929 (grey), after ≈ #871818 (dark red), matching Skia.

Validation

  • Runtime (Skia Desktop, net11.0-desktop): Given_AcrylicBrush 6/6 on Skia and 6/6 with UNO_WEBGPU=1; Given_EffectBrush_Parity 5/5 on WebGPU. The new test fails on master with WebGPU.
  • DrawingBackends sample: the WebGPU acrylic card now matches the Skia one.
  • Perf (laptop, WebGPU, RenderStress + RealWorld, 28 scenes, interleaved, maximized): no regression; AcrylicShell 9.0 → 8.8 ms (within noise).

PR Checklist ✅

🤖 Generated with Claude Code

The acrylic composite mixed the luminosity colour over the blurred
backdrop and drew the tint as a second SrcOver quad, so the dark-theme
luminosity (0.96 opaque) flattened any content behind into grey.
Apply the Luminosity and Color blends in the composite shader, as Skia
does, and share the blend helpers with the generic blend module.

Fixes unoplatform#25357

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 245313 found UI Test snapshots differences: skia-linux-screenshots: 239, skia-windows-screenshots: 271

Details
  • skia-linux-screenshots: 239 changed over 2494

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedVisualsTestbedPage.png-dark
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AppWindowTitleBar Properties.png-dark
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • AnimatedBackVisualSourceSamplePage.png
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • Buttons.png
    • ClipboardTests.png-dark
  • skia-windows-screenshots: 271 changed over 2494

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AnimatedVisualsTestbedPage.png
    • AnimatedBackVisualSourceSamplePage.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_StructureAndProps.png-dark
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark

@MartinZikmund MartinZikmund left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Same fix as #26290 (closed in favour of this one), with the blend helpers shared rather than duplicated. The Managed Binaries failure is the WebAssemblyRuntime PackageDiff check, which is unrelated; a rebase or re-run should clear it.

@MartinZikmund
MartinZikmund merged commit 5330c3a into unoplatform:master Nov 11, 2026
68 of 70 checks passed
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.

WebGPU backend: AcrylicBrush loses the backdrop's hue because Luminosity/Color blends are replaced by SrcOver

4 participants