#graphics #smaa #antialiasing

smaa

A library for post process antialiasing using SMAA

11 breaking releases

0.12.0 Nov 25, 2023
0.10.0 Jun 10, 2023
0.9.0 Feb 9, 2023
0.8.0 Oct 9, 2022
0.2.1 Mar 28, 2021

#318 in Rendering

Download history 69/week @ 2023-11-05 51/week @ 2023-11-12 78/week @ 2023-11-19 113/week @ 2023-11-26 93/week @ 2023-12-03 58/week @ 2023-12-10 105/week @ 2023-12-17 66/week @ 2023-12-24 59/week @ 2023-12-31 93/week @ 2024-01-07 71/week @ 2024-01-14 66/week @ 2024-01-21 58/week @ 2024-01-28 47/week @ 2024-02-04 103/week @ 2024-02-11 314/week @ 2024-02-18

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

MIT license

1.5MB
16K 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

~6–42MB
~613K SLoC