pub struct GBufferBuilder { /* private fields */ }Expand description
Fluent builder for constructing a G-Buffer with a custom layout.
Implementations§
Source§impl GBufferBuilder
impl GBufferBuilder
pub fn new(width: u32, height: u32) -> Self
Sourcepub fn with_default_layout(self) -> Self
pub fn with_default_layout(self) -> Self
Use the default layout.
Sourcepub fn with_thin_layout(self) -> Self
pub fn with_thin_layout(self) -> Self
Use the thin/minimal layout.
Sourcepub fn add_attachment(self, attachment: GBufferAttachment) -> Self
pub fn add_attachment(self, attachment: GBufferAttachment) -> Self
Add a custom color attachment.
Sourcepub fn with_depth_format(self, format: GBufferAttachmentFormat) -> Self
pub fn with_depth_format(self, format: GBufferAttachmentFormat) -> Self
Set the depth format.
Sourcepub fn with_octahedral_normals(self, enabled: bool) -> Self
pub fn with_octahedral_normals(self, enabled: bool) -> Self
Enable or disable octahedral normal encoding.
Sourcepub fn with_max_attachments(self, max: u32) -> Self
pub fn with_max_attachments(self, max: u32) -> Self
Set maximum color attachments.
Sourcepub fn auto_create(self, enabled: bool) -> Self
pub fn auto_create(self, enabled: bool) -> Self
Whether to auto-create GPU resources on build.
Sourcepub fn build(self) -> Result<GBuffer, GBufferError>
pub fn build(self) -> Result<GBuffer, GBufferError>
Build the G-Buffer.
Auto Trait Implementations§
impl Freeze for GBufferBuilder
impl RefUnwindSafe for GBufferBuilder
impl Send for GBufferBuilder
impl Sync for GBufferBuilder
impl Unpin for GBufferBuilder
impl UnsafeUnpin for GBufferBuilder
impl UnwindSafe for GBufferBuilder
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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.