Public Types | Public Member Functions

sp::video::BloomEffect Class Reference

GBuffer object which contains all textures which are required for a deferred renderer. More...

#include <spBloomEffect.hpp>

Inheritance diagram for sp::video::BloomEffect:
sp::video::PostProcessingEffect

List of all members.

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.
TexturegetTexture (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.

Detailed Description

GBuffer object which contains all textures which are required for a deferred renderer.


Member Enumeration Documentation

Bloom effect render target names.

Enumerator:
RENDERTARGET_INPUT_COLOR 

Color result from deferred- or forward renderer for bloom filter.

RENDERTARGET_INPUT_GLOSS 

Gloss result from deferred- or forward renderer for bloom filter.

RENDERTARGET_GLOSS_1ST_PASS 

Temporary gloss texture for gaussian blur (1st render pass).

RENDERTARGET_GLOSS_2ND_PASS 

Temporary gloss texture for gaussian blur (2nd render pass).

RENDERTARGET_COUNT 

Internal count constant. Don't use it to access a texture!


Constructor & Destructor Documentation

sp::video::BloomEffect::BloomEffect (  ) 
sp::video::BloomEffect::~BloomEffect (  ) 

Member Function Documentation

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.

Parameters:
[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.

Parameters:
Type,: Specifies the texture name which is to be returned. This must not be RENDERTARGET_COUNT!
Returns:
Pointer to the specified Texture object.
void sp::video::BloomEffect::setFactor ( f32  GaussianMultiplier  ) 

Changes the gaussian multiplier if a bloom filter has already been generated.

Parameters:
[in] GaussianMultiplier Specifies the gaussian multiplier for the bloom filter. By default 0.6.
Note:
This has no effect until "createResources" was called.
See also:
PostProcessingEffect::valid

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines