Skip to main content

PostStack

Struct PostStack 

Source
pub struct PostStack { /* private fields */ }
Expand description

Ordered post-processing stack with cached GPU resources.

Implementations§

Source§

impl PostStack

Source

pub fn new() -> Self

Creates an empty post stack.

Source

pub fn effects(&self) -> &[PostEffect]

Returns the ordered effects.

Source

pub fn len(&self) -> usize

Returns the number of effects in the stack.

Source

pub fn is_empty(&self) -> bool

Returns whether the stack is empty.

Source

pub fn with_bloom(self, config: BloomConfig) -> Self

Adds a bloom pass.

Source

pub fn with_ssao(self, config: SsaoConfig) -> Self

Adds an SSAO pass.

Source

pub fn with_tonemap(self, mapper: ToneMapper) -> Self

Adds a tone mapping pass.

Source

pub fn with_fxaa(self, config: FxaaConfig) -> Self

Adds an FXAA pass.

Source

pub fn with_taa(self, config: TaaConfig) -> Self

Adds a TAA pass.

Source

pub fn with_smaa(self, config: SmaaConfig) -> Self

Adds an SMAA pass.

Source

pub fn with_dof(self, config: DofConfig) -> Self

Adds a depth-of-field pass.

Source

pub fn with_fog(self, config: FogPostConfig) -> Self

Adds a fog blend pass.

Source

pub fn with_outline(self, config: OutlineConfig) -> Self

Adds an outline pass.

Source

pub fn with_motion_blur(self, config: MotionBlurConfig) -> Self

Adds a motion blur pass.

Source

pub fn remove(&mut self, index: usize) -> Option<PostEffect>

Removes an effect by index.

Source

pub fn clear(&mut self)

Clears all effects while retaining GPU resources for reuse.

Source

pub fn apply_to_view( &mut self, device: &Device, queue: &Queue, source: &TextureView, output: &TextureView, context: PostContext, ) -> Result<PostStats, ScenixError>

Applies the stack from source to output and submits a GPU command buffer.

Trait Implementations§

Source§

impl Default for PostStack

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,