GBuffer object which contains all textures which are required for a deferred renderer. More...
#include <spBloomEffect.hpp>
Public Types | |
enum | ERenderTargets { RENDERTARGET_INPUT_COLOR, RENDERTARGET_INPUT_GLOSS, RENDERTARGET_GLOSS_1ST_PASS, RENDERTARGET_GLOSS_2ND_PASS, RENDERTARGET_COUNT } |
Bloom effect render target names. More... | |
Public Member Functions | |
BloomEffect () | |
~BloomEffect () | |
bool | createResources (const dim::size2di &Resolution) |
void | deleteResources () |
void | bindRenderTargets () |
void | drawEffect (Texture *RenderTarget=0) |
void | setFactor (f32 GaussianMultiplier) |
dim::size2di | getResolution () const |
Returns the resolution which has been set after creating the resources for this effect. | |
Texture * | getTexture (const ERenderTargets Type) |
f32 | getFactor () const |
Returns the bloom factor or rather the gaussian multiplier. By default 0.6. | |
bool | active () const |
Returns true if this effect is active. The effect is active if bloom factor is greater than 0.0. |
GBuffer object which contains all textures which are required for a deferred renderer.
Bloom effect render target names.
sp::video::BloomEffect::BloomEffect | ( | ) |
sp::video::BloomEffect::~BloomEffect | ( | ) |
bool sp::video::BloomEffect::active | ( | ) | const [inline] |
Returns true if this effect is active. The effect is active if bloom factor is greater than 0.0.
void sp::video::BloomEffect::bindRenderTargets | ( | ) |
Binds the render targets for this effect. For the bloom effect a multi-render-target texture is used with exactly two textures. After calling this function you have to render into these two framebuffers. The first one stores the color information and the second one stores the gloss factor. Use render-target index 0 for the color (write to RGB components) and index 1 for the gloss factor (write to Alpha channel). The following pixel shader pseudo code illustrates that:
struct SPixelOutput { float4 Color : COLOR0; float4 Gloss : COLOR1; }; // ... Out.Color.rgb = BloomColorInput; Out.Gloss.a = BloomGlossInput;
bool sp::video::BloomEffect::createResources | ( | const dim::size2di & | Resolution | ) |
void sp::video::BloomEffect::deleteResources | ( | ) |
void sp::video::BloomEffect::drawEffect | ( | Texture * | RenderTarget = 0 |
) | [virtual] |
Draws the post-processing effect onto the screen or into the render target.
[in] | RenderTarget | Pointer to a valid render target texture or null if the effect is to be renderd directly into the frame buffer (or rather onto the screen). |
Implements sp::video::PostProcessingEffect.
f32 sp::video::BloomEffect::getFactor | ( | ) | const [inline] |
Returns the bloom factor or rather the gaussian multiplier. By default 0.6.
dim::size2di sp::video::BloomEffect::getResolution | ( | ) | const [inline] |
Returns the resolution which has been set after creating the resources for this effect.
Texture* sp::video::BloomEffect::getTexture | ( | const ERenderTargets | Type | ) | [inline] |
Returns the specified effect texture.
Type,: | Specifies the texture name which is to be returned. This must not be RENDERTARGET_COUNT! |
void sp::video::BloomEffect::setFactor | ( | f32 | GaussianMultiplier | ) |
Changes the gaussian multiplier if a bloom filter has already been generated.
[in] | GaussianMultiplier | Specifies the gaussian multiplier for the bloom filter. By default 0.6. |