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

VariableBlurView() by itself? #1

Open
Saim-Khan1 opened this issue Nov 29, 2023 · 2 comments
Open

VariableBlurView() by itself? #1

Saim-Khan1 opened this issue Nov 29, 2023 · 2 comments

Comments

@Saim-Khan1
Copy link

Hey @daprice! Love this repo, been waiting for a Metal based progressive blur for a while now so thanks a lot for putting this together! Was just wondering whether it'd be possible to have a VariableBlurView() as a view itself, so it can be, for example, put on top of content in a ZStack or as an overlay instead of being applied to a view as a modifier? A bit like UIKit's UIVisualEffectView I suppose. That'd be awesome, thanks a lot :)

@daprice
Copy link
Owner

daprice commented Nov 29, 2023

I’d love that too, but I don’t think SwiftUI currently provides a documented way for shaders to sample from layers behind a view, only from the view’s own layer.

The closest thing I can find is the ability to use a Shader as a ShapeStyle, which in theory could work similar to Apple’s built in Materials, but the shader function signature they give doesn’t pass a layer to sample from.

I hope future versions of SwiftUI expand shader functionality to allow this. 🤞

Leaving this issue open in case someone else knows of a way.

@Saim-Khan1
Copy link
Author

Ahh I see, that's a shame. Thanks a lot for looking into it anyway, and yep fingers crossed! 🤞

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

No branches or pull requests

2 participants