1 #ifndef MSP_GL_BLOOM_H_
2 #define MSP_GL_BLOOM_H_
4 #include "framebuffer.h"
6 #include "postprocessor.h"
10 #include "programdata.h"
11 #include "rendertarget.h"
17 The Bloom post-processing effect causes very bright areas of the image to bleed
18 into surrounding pixels. Commonly used together with HDR rendering.
20 The technique used is to gaussian blur the image and then blend the result with
21 the original image. With suitable parameters, this effect may also be used as
24 class Bloom: public PostProcessor
27 struct Template: public PostProcessor::Template
29 class Loader: public DataFile::DerivedObjectLoader<Template, PostProcessor::Template::Loader>
40 virtual Bloom *create(unsigned, unsigned) const;
44 RenderTarget *target[2];
45 ProgramData common_shdata;
47 ProgramData blur_shdata[2];
48 Program combine_shader;
49 Texturing combine_texturing;
53 Bloom(unsigned, unsigned);
56 /** Sets the σ value of the gaussian blur. Values much larger than 4.0 are
57 likely to cause artifacts. */
58 void set_radius(float);
60 /** Sets the blend factor between original and blurred images. Larger
61 values mean more blurriness. */
62 void set_strength(float);
64 virtual void render(Renderer &, const Texture2D &, const Texture2D &);