#graphics #antialiasing #smaa

smaa

A library for post process antialiasing using SMAA

8 releases (breaking)

Uses new Rust 2021

0.7.0 Jul 3, 2022
0.6.0 Dec 22, 2021
0.5.0 Nov 7, 2021
0.4.0 Jul 13, 2021
0.1.0 Feb 6, 2021

#23 in Rendering

Download history 23/week @ 2022-04-15 24/week @ 2022-04-22 68/week @ 2022-04-29 69/week @ 2022-05-06 136/week @ 2022-05-13 41/week @ 2022-05-20 60/week @ 2022-05-27 79/week @ 2022-06-03 29/week @ 2022-06-10 34/week @ 2022-06-17 15/week @ 2022-06-24 49/week @ 2022-07-01 22/week @ 2022-07-08 42/week @ 2022-07-15 43/week @ 2022-07-22 28/week @ 2022-07-29

139 downloads per month
Used in 3 crates (2 directly)

MIT license

1.5MB
17K SLoC

smaa-rs crates.io docs.rs

Post-process antialiasing for wgpu-rs, relying on the SMAA reference implementation.

Example

// 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, _, control_flow| {
    match event {
        Event::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();
        }
        _ => {}
    }
});

Dependencies

~5–13MB
~244K SLoC