Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: bring back global composition (UWP regression) #5025

Open
Sergio0694 opened this issue May 16, 2021 · 7 comments
Open

Proposal: bring back global composition (UWP regression) #5025

Sergio0694 opened this issue May 16, 2021 · 7 comments
Labels
feature proposal New feature proposal team-CompInput Issue for IXP (Composition, Input) team

Comments

@Sergio0694
Copy link
Member

Sergio0694 commented May 16, 2021

Proposal: bring back global composition (UWP regression)

Follow up from #4947

Summary

As described in the related issue, currently CompositionBackdropBrush cannot sample from over a SwapChainPanel. This makes it impossible to apply effects such as GaussianBlurEffect over content being rendered in a SwapChainPanel. This proposal is about allowing content in a SwapChainPanel to be sampled just like other normal WinUI content in a window, so that it can be used as input in any composition pipeline that starts with a CompositionBackdropBrush.

In general, the ask is to bring back global composition and get feature parity with UWP.

In other words, DirectX swapchain content should be visible to the compositor (eg. backdrop brushes).

Rationale

  • The SwapChainPanel isn't always used as a full-window renderer, but it's often used to compose UI components in an application (eg. a map control, some custom renderer inside a template, etc.). With the current limitation in WinUI 3, this makes it impossible to then apply effects on top of the entire UI (eg. a blur effect if a popup is opened), because those SwapChainPanel-s would then visibly be "glitched" next to the normal WinUI 3 content behind the effect.
  • Make the behavior consistent with UWP (this could be seen as a regression in WinUI 3)
  • Make the behavior more intuitive for developers ("why are these effects not working here?")

Scope

Capability Priority
Allow composition backdrops to sample over DirectX swapchains Must

In other words: an in-app acrylic brush should work as expected when placed above a SwapChainPanel control.

@Sergio0694 Sergio0694 added the feature proposal New feature proposal label May 16, 2021
@ghost ghost added this to Freezer in Feature tracking May 16, 2021
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label May 16, 2021
@StephenLPeters StephenLPeters added the team-Rendering Issue for the Rendering team label May 17, 2021
@StephenLPeters
Copy link
Contributor

@codendone FYI

@codendone codendone added team-CompInput Issue for IXP (Composition, Input) team and removed team-Rendering Issue for the Rendering team labels May 18, 2021
@kevinguo305
Copy link

Thanks for submitting this proposal Sergio! It's in our backlog and we'll consider this for a future release.

@Sergio0694
Copy link
Member Author

This is great to hear! Thank you for the follow up! 😄

@Sergio0694
Copy link
Member Author

@kevinguo305 @codendone @marb2000 I thought I'd share an actual example of where this feature would be cool to have, especially given it's a regression from UWP (and we're telling people to move from UWP to WinUI 3). Here's a sample app for my library ComputeSharp, where I display a bunch of shaders rendered to a ComputeShaderPanel control I wrote to easily render shaders in XAML. I'm applying an in-app acrylic brush to the window content when the drawer is opened, which on UWP results in this super cool glass effect over the current shader, bringing focus for the user to the shaders list at the bottom. This is just an example, but the same would apply of course to all cases where people are just rendering whatever content they might need into their apps (eg. a custom map, a 3D object viewer, an animated background, you name it), then wanted to open an overlay and blur the app content to bring attention to the dialog that just opened, and those swap chains in the background would just "skip" the blur and kinda "peek through", which would be quite jarring to see and arguably just look glitchy. It would really be awesome if we could reach feature parity with this on WinUI 3 in the future 😊

ComputeSharpOnUwpSample.mp4

@bpulliam bpulliam removed the needs-triage Issue needs to be triaged by the area owners label Dec 7, 2022
@Sergio0694
Copy link
Member Author

Bumping this (see #8638).

@Sergio0694 Sergio0694 changed the title Proposal: CompositionBackdropBrush sampling over SwapChainPanel Proposal: bring back global composition (UWP regression) Nov 17, 2023
@Sergio0694
Copy link
Member Author

I've updated the title and description to be clearer and more generally applicable. Commenting here and not internally since this is a feature that everyone should be able to use, so I feel like info on this should just be shared in the open. @duncanmacmichael @bpulliam would you be able to help getting this triaged and possibly added to some roadmap, just to make sure it doesn't get lost? I think this is one of the most notable regressions of WinUI 3 compared to UWP (it's just one of the things that stopped working entirely due to the switch to the lifted compositor), and it would really be awesome to get this fixed. Bringing global composition back would allow apps to create very advanced visuals with mixed XAML and DirectX content 🙂


As an example, consider the amazing Lively Weather app:

lively_weather_3.mp4

The UI has a swapchain in the background, with XAML content overlayed above it. You can see how all widgets also have an in-app acrylic brush, which blurs the swapchain content behind them. This is currently completely impossible to do on WinUI 3.

@duncanmacmichael
Copy link
Member

Thanks Sergio, really appreciate it! Great details and example. I'll bring this up in our next feature request triage and we'll go from there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature proposal New feature proposal team-CompInput Issue for IXP (Composition, Input) team
Projects
Development

No branches or pull requests

6 participants