We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
in Swiftui you can create custom shader effects and apply them to images like so:
Image(systemName: "figure.run.circle.fill") .font(.system(size: 300)) .colorEffect(ShaderLibrary.checkerboard(.float(10), .color(.blue)))
let effect = vger::Effect::from_source("examples/gaussian_blur.wgsl"); vger.apply_effect(effect);
or
view.apply_effect(effect)
in use
// draws a blurred white circle. fn main() { canvas(|_, rect, vger| { vger.translate(rect.center() - LocalPoint::zero()); let radius = 100.0; let paint = vger.color_paint(vger::Color { r: 1.0, g: 1.0, b: 1.0, a: 1.0, }); vger.fill_circle(LocalPoint::zero(), radius, paint); let effect = vger::Effect::from_source("examples/gaussian_blur.wgsl"); vger.apply_effect(effect); }) .run() }
The text was updated successfully, but these errors were encountered:
What would the shader look like?
In SwiftUI, it's quite easy to write the shaders due to the [[stitchable]] attribute. See https://www.hackingwithswift.com/quick-start/swiftui/how-to-add-metal-shaders-to-swiftui-views-using-layer-effects
[[stitchable]]
Would apply_effect apply to the entire window? That could be expensive and not desired. How would uniforms be passed to the shaders?
apply_effect
Sorry, something went wrong.
No branches or pull requests
Background
in Swiftui you can create custom shader effects and apply them to images like so:
Proposed changes
What it allows for the user
OR / AND
Proposed changes
or
in use
What it allows for the user
The text was updated successfully, but these errors were encountered: