3 This file is part of libmspgl
4 Copyright © 2009 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GL_BLOOM_H_
9 #define MSP_GL_BLOOM_H_
11 #include "framebuffer.h"
13 #include "postprocessor.h"
14 #include "texture2d.h"
16 #include "programdata.h"
22 The Bloom post-processing effect causes very bright areas of the image to bleed
23 into surrounding pixels. Commonly used together with HDR rendering.
25 The technique used is to gaussian blur the image and then blend the result with
26 the original image. With suitable parameters, this effect may also be used as
29 class Bloom: public PostProcessor
35 ProgramData blur_shdata[2];
36 Program combine_shader;
37 ProgramData combine_shdata;
41 Bloom(unsigned, unsigned);
43 /** Sets the σ value of the gaussian blur. Values much larger than 4.0 are
44 likely to cause artifacts. */
45 void set_radius(float);
47 /** Sets the blend factor between original and blurred images. Larger
48 values mean more blurriness. */
49 void set_strength(float);
51 virtual void render(const Texture2D &);