Crates.io | smaa |
lib.rs | smaa |
version | 0.15.0 |
source | src |
created_at | 2021-02-06 17:49:24.035868 |
updated_at | 2024-07-28 22:11:33.9203 |
description | A library for post process antialiasing using SMAA |
homepage | |
repository | https://github.com/fintelia/smaa-rs |
max_upload_size | |
id | 351588 |
size | 1,323,119 |
Post-process antialiasing for wgpu-rs, relying on the SMAA reference implementation.
// Create SMAA target
let mut smaa_target = SmaaTarget::new(
&device,
&queue,
window.inner_size().width,
window.inner_size().height,
swapchain_format,
SmaaMode::Smaa1X,
);
// Main loop
event_loop.run(move |event, event_loop| {
if let Event::WindowEvent { event, .. } = event {
match event {
WindowEvent::RedrawRequested => {
let output_frame = surface.get_current_texture().unwrap();
let output_view = output_frame.texture.create_view(&Default::default());
let smaa_frame = smaa_target.start_frame(&device, &queue, &output_view);
// Render the scene into `*smaa_frame`.
// [...]
smaa_frame.resolve();
output_frame.present();
}
_ => {}
}
}
});