From 3fcdc5a4926dcad89a3346977d862c505993d265 Mon Sep 17 00:00:00 2001 From: Wybe Westra Date: Sun, 16 Jan 2022 21:09:15 +0000 Subject: [PATCH] Expanded Msaa documentation. (#3693) - Added default value. - Links to the explanation of Msaa on wikipedia. - Added a short example to show how to use the struct on an app. Fixes #3167. --- crates/bevy_render/src/view/mod.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/bevy_render/src/view/mod.rs b/crates/bevy_render/src/view/mod.rs index 8711c73723..40e5dbb335 100644 --- a/crates/bevy_render/src/view/mod.rs +++ b/crates/bevy_render/src/view/mod.rs @@ -40,9 +40,22 @@ impl Plugin for ViewPlugin { } #[derive(Clone)] +/// Configuration resource for [Multi-Sample Anti-Aliasing](https://en.wikipedia.org/wiki/Multisample_anti-aliasing). +/// +/// # Example +/// ``` +/// # use bevy_app::prelude::App; +/// # use bevy_render::prelude::Msaa; +/// App::new() +/// .insert_resource(Msaa { samples: 4 }) +/// .run(); +/// ``` pub struct Msaa { /// The number of samples to run for Multi-Sample Anti-Aliasing. Higher numbers result in - /// smoother edges. Note that WGPU currently only supports 1 or 4 samples. + /// smoother edges. + /// Defaults to 4. + /// + /// Note that WGPU currently only supports 1 or 4 samples. /// Ultimately we plan on supporting whatever is natively supported on a given device. /// Check out this issue for more info: /// It defaults to 1 in wasm -