Background
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)))
Proposed changes
- Expose the draw context to the user
What it allows for the user
- GPU Computation for particle systems etc
- Rendering custom ui elements
- Custom renderer
OR / AND
Proposed changes
- Add a way for the user to create a custom wgsl effect. Example api:
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()
}
What it allows for the user
- Shader effects which could be applied in theory to any view like shadows, color grading, blurs
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