3 This file is part of libmspgl
4 Copyright © 2009-2011 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"
15 #include "texturing.h"
17 #include "programdata.h"
23 The Bloom post-processing effect causes very bright areas of the image to bleed
24 into surrounding pixels. Commonly used together with HDR rendering.
26 The technique used is to gaussian blur the image and then blend the result with
27 the original image. With suitable parameters, this effect may also be used as
30 class Bloom: public PostProcessor
36 ProgramData blur_shdata_common;
37 ProgramData blur_shdata_x;
38 ProgramData blur_shdata_y;
39 Program combine_shader;
40 ProgramData combine_shdata;
41 Texturing combine_texturing;
45 Bloom(unsigned, unsigned);
47 /** Sets the σ value of the gaussian blur. Values much larger than 4.0 are
48 likely to cause artifacts. */
49 void set_radius(float);
51 /** Sets the blend factor between original and blurred images. Larger
52 values mean more blurriness. */
53 void set_strength(float);
55 virtual void render(const Texture2D &, const Texture2D &);