Struct radiant_rs::postprocessors::Basic[][src]

pub struct Basic { /* fields omitted */ }

A basic postprocessor that applies a Program to the given input once.

Postprocessors are used with Renderer::postprocess(). The associated type for this postprocessor is BlendMode and is expected as second argument to the postprocess() method

Examples

// Load a shader progam.
let my_program = Program::from_string(&rendercontext, &program_source).unwrap();

// Create the postprocessor with the program.
let my_postprocessor = postprocessors::Basic::new(&rendercontext, my_program);

// ... in your renderloop...
renderer.postprocess(&my_postprocessor, &blendmodes::ALPHA, || {
    renderer.clear(Color::BLACK);
    renderer.draw_layer(&my_layer, 0);
});

Methods

impl Basic
[src]

Creates a new instance. The shader can use sheet*() to access the input texture.

Trait Implementations

impl Postprocessor for Basic
[src]

The Basic postprocessor accepts a blendmode as argument to Renderer::postprocess().

Expected to return a texture for user drawing operations to target.

Expected to draw the final result. Draws issued within this function will target the rendertarget that the postprocessor is supposed to render to. Read more

Optionally expected to processes input data. Draws issued within this function will target the texure returned by target() unless overridden via Renderer::render_to(). Read more

Auto Trait Implementations

impl !Send for Basic

impl !Sync for Basic