Skip to content
Use SMAA antialiasing in gfx-rs applications
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
third_party
.gitignore
.travis.yml
Cargo.toml
LICENSE
README.md

README.md

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);
     });
}
You can’t perform that action at this time.