pub struct RendererOptions {
pub msaa_samples: u32,
pub depth_stencil_format: Option<TextureFormat>,
pub dithering: bool,
pub predictable_texture_filtering: bool,
}Expand description
Ways to configure Renderer during creation.
Fields§
§msaa_samples: u32Set 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.
depth_stencil_format: Option<TextureFormat>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).
dithering: boolControls 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.
predictable_texture_filtering: boolPerform texture filtering in software?
This is useful when you want predictable rendering across different hardware, e.g. for kittest snapshots.
Default is false.
Implementations§
Source§impl RendererOptions
impl RendererOptions
Sourcepub const PREDICTABLE: Self
pub const PREDICTABLE: Self
Set options that produce the most predicatable output.
Useful for image snapshot tests.
Trait Implementations§
Source§impl Clone for RendererOptions
impl Clone for RendererOptions
Source§fn clone(&self) -> RendererOptions
fn clone(&self) -> RendererOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RendererOptions
impl Debug for RendererOptions
Source§impl Default for RendererOptions
impl Default for RendererOptions
impl Copy for RendererOptions
Auto Trait Implementations§
impl Freeze for RendererOptions
impl RefUnwindSafe for RendererOptions
impl Send for RendererOptions
impl Sync for RendererOptions
impl Unpin for RendererOptions
impl UnwindSafe for RendererOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.