1 #ifndef MSP_GL_AMBIENTOCCLUSION_H_
2 #define MSP_GL_AMBIENTOCCLUSION_H_
4 #include "framebuffer.h"
6 #include "postprocessor.h"
8 #include "programdata.h"
9 #include "rendertarget.h"
10 #include "texture2d.h"
11 #include "texturing.h"
17 Implements screen-space ambient occlusion.
19 http://en.wikipedia.org/wiki/Screen_Space_Ambient_Occlusion
21 class AmbientOcclusion: public PostProcessor
24 Texture2D rotate_lookup;
25 RenderTarget occlude_target;
27 Program occlude_shader;
28 Program combine_shader;
29 mutable ProgramData shdata;
33 AmbientOcclusion(unsigned, unsigned, float = 1.0f);
36 static float random(unsigned &);
39 void set_n_samples(unsigned);
40 void set_occlusion_radius(float);
43 void set_depth_ratio(float);
45 void set_darkness(float);
47 virtual void render(Renderer &, const Texture2D &, const Texture2D &);