Skip to content

Commit 3fcdc5a

Browse files
committed
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.
1 parent 758fc5a commit 3fcdc5a

File tree

1 file changed

+14
-1
lines changed
  • crates/bevy_render/src/view

1 file changed

+14
-1
lines changed

crates/bevy_render/src/view/mod.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,22 @@ impl Plugin for ViewPlugin {
4040
}
4141

4242
#[derive(Clone)]
43+
/// Configuration resource for [Multi-Sample Anti-Aliasing](https://en.wikipedia.org/wiki/Multisample_anti-aliasing).
44+
///
45+
/// # Example
46+
/// ```
47+
/// # use bevy_app::prelude::App;
48+
/// # use bevy_render::prelude::Msaa;
49+
/// App::new()
50+
/// .insert_resource(Msaa { samples: 4 })
51+
/// .run();
52+
/// ```
4353
pub struct Msaa {
4454
/// The number of samples to run for Multi-Sample Anti-Aliasing. Higher numbers result in
45-
/// smoother edges. Note that WGPU currently only supports 1 or 4 samples.
55+
/// smoother edges.
56+
/// Defaults to 4.
57+
///
58+
/// Note that WGPU currently only supports 1 or 4 samples.
4659
/// Ultimately we plan on supporting whatever is natively supported on a given device.
4760
/// Check out this issue for more info: <https://github.com/gfx-rs/wgpu/issues/1832>
4861
/// It defaults to 1 in wasm - <https://github.com/gfx-rs/wgpu/issues/2149>

0 commit comments

Comments
 (0)