Merged
Conversation
|
Preview available at https://egui-pr-preview.github.io/pr/7601-emilkrefactor-wgpu-options View snapshot changes at kitdiff |
lucasmerlin
approved these changes
Oct 7, 2025
Comment on lines
+179
to
+207
| /// Ways to configure [`Renderer`] during creation. | ||
| #[derive(Clone, Copy, Debug)] | ||
| pub struct RendererOptions { | ||
| /// Set the level of the multisampling anti-aliasing (MSAA). | ||
| /// | ||
| /// Must be a power-of-two. Higher = more smooth 3D. | ||
| /// | ||
| /// A value of `0` or `1` turns it off (default). | ||
| /// | ||
| /// `egui` already performs anti-aliasing via "feathering" | ||
| /// (controlled by [`egui::epaint::TessellationOptions`]), | ||
| /// but if you are embedding 3D in egui you may want to turn on multisampling. | ||
| pub msaa_samples: u32, | ||
|
|
||
| /// What format to use for the depth and stencil buffers, | ||
| /// e.g. [`wgpu::TextureFormat::Depth32FloatStencil8`]. | ||
| /// | ||
| /// egui doesn't need depth/stencil, so the default value is `None` (no depth or stancil buffers). | ||
| pub depth_stencil_format: Option<wgpu::TextureFormat>, | ||
|
|
||
| /// Controls whether to apply dithering to minimize banding artifacts. | ||
| /// | ||
| /// Dithering assumes an sRGB output and thus will apply noise to any input value that lies between | ||
| /// two 8bit values after applying the sRGB OETF function, i.e. if it's not a whole 8bit value in "gamma space". | ||
| /// This means that only inputs from texture interpolation and vertex colors should be affected in practice. | ||
| /// | ||
| /// Defaults to true. | ||
| pub dithering: bool, | ||
| } |
RendererOptionsegui_wgpu::RendererOptions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will make it easier to add new options in the future.
Also, we can document struct fields, but not parameters.