Struct radiant_rs::postprocessors::Bloom [−][src]
pub struct Bloom { pub iterations: u8, pub iter_blend: BlendMode, pub draw_blend: BlendMode, pub draw_color: Color, pub clear: bool, pub vertical: u8, pub horizontal: u8, // some fields omitted }
A simple bloom postprocessor.
This effect internally uses textures of decreasing dimensions to amplify an initially small blur effect via linear interpolation performed by the gpu when scaling texture contents.
Fields
iterations: u8
Number of blur iterations.
iter_blend: BlendMode
Blendmode to use in blur iterations.
draw_blend: BlendMode
Blendmode to use for the final drawing operation.
draw_color: Color
Color multiplicator for the final drawing operation.
clear: bool
Clear internal textures before processing.
vertical: u8
Number of scaling steps used vertically. Limited to 5.
horizontal: u8
Number of scaling steps used horizontally. Limited to 5.
Methods
impl Bloom
[src]
impl Bloom
pub fn new(
context: &RenderContext,
base_divider: u32,
divider_factor: u32
) -> Self
[src]
pub fn new(
context: &RenderContext,
base_divider: u32,
divider_factor: u32
) -> Self
Creates a new Bloom effect instance.
Initial texture size is computed from frame dimensions divided by base_divider
. For each additional texture
base_divider
is multiplied by divider_factor
.
pub fn rebuild(
&mut self,
context: &RenderContext,
base_divider: u32,
divider_factor: u32
)
[src]
pub fn rebuild(
&mut self,
context: &RenderContext,
base_divider: u32,
divider_factor: u32
)
Rebuilds internal textures to current frame size.
Initial texture size is computed from frame dimensions divided by base_divider
. For each additional texture
base_divider
is multiplied by divider_factor
.
Trait Implementations
impl Postprocessor for Bloom
[src]
impl Postprocessor for Bloom
type T = ()
Custom type for the args parameter supplied to process()
and draw()
.
fn target(&self) -> &Texture
[src]
fn target(&self) -> &Texture
Returns the target where the postprocessor expects the unprocessed input.
fn process(&self, renderer: &Renderer, _: &Self::T)
[src]
fn process(&self, renderer: &Renderer, _: &Self::T)
Process received data.
fn draw(&self, renderer: &Renderer, _: &Self::T)
[src]
fn draw(&self, renderer: &Renderer, _: &Self::T)
Draw processed input. The renderer has already set the correct target.