#gfx #graphics #antialiasing #SMAA

gfx_smaa

A library for post process antialiasing using SMAA

3 unstable releases

0.2.1 Oct 5, 2018
0.2.0 Aug 6, 2018
0.1.0 Jan 28, 2018

#41 in Rendering

Download history 48/week @ 2018-11-11 10/week @ 2018-11-18 15/week @ 2018-11-25 6/week @ 2018-12-02 6/week @ 2018-12-09 31/week @ 2018-12-16 43/week @ 2018-12-23 6/week @ 2019-01-06 6/week @ 2019-01-13 5/week @ 2019-01-27 4/week @ 2019-02-03 1/week @ 2019-02-10 1/week @ 2019-02-17

42 downloads per month

MIT license

1MB
15K SLoC

gfx_smaa crates.io docs.rs Travis

A library for post process antialiasing for the gfx-rs graphics API, based on the SMAA reference implementation. Currently only works with OpenGL 3+, but support for other graphics APIs is planned.

Example

// create window
let mut window: PistonWindow = WindowSettings::new("SMAA", (640, 480)).build().unwrap();

// create target
let mut target = SmaaTarget::<_>::new(&mut window.factory,
                                      window.output_color.clone(),
                                      640, 480).unwrap();

// main loop
while let Some(e) = window.next() {
    window.draw_3d(&e, |window| {
        // clear depth and color buffers.
        window.encoder.clear_depth(&target.output_depth(), 1.0);
        window.encoder.clear(&target.output_color(), [0.0, 0.0, 0.0, 1.0]);

        // Render the scene.
        ...

        // Perform actual antialiasing operation and write the result to the screen.
        target.resolve(&mut window.encoder);
     });
}

Dependencies

~1MB
~26K SLoC