]> git.tdb.fi Git - libs/gl.git/blob - source/ambientocclusion.h
Immediate update camera aspect in View::set_camera
[libs/gl.git] / source / ambientocclusion.h
1 #ifndef MSP_GL_AMBIENTOCCLUSION_H_
2 #define MSP_GL_AMBIENTOCCLUSION_H_
3
4 #include "framebuffer.h"
5 #include "mesh.h"
6 #include "postprocessor.h"
7 #include "program.h"
8 #include "programdata.h"
9 #include "rendertarget.h"
10 #include "texture2d.h"
11 #include "texturing.h"
12
13 namespace Msp {
14 namespace GL {
15
16 /**
17 Implements screen-space ambient occlusion.
18
19 http://en.wikipedia.org/wiki/Screen_Space_Ambient_Occlusion
20 */
21 class AmbientOcclusion: public PostProcessor
22 {
23 private:
24         Texture2D rotate_lookup;
25         RenderTarget occlude_target;
26         Texturing texturing;
27         Program occlude_shader;
28         Program combine_shader;
29         ProgramData shdata;
30         const Mesh &quad;
31
32 public:
33         AmbientOcclusion(unsigned, unsigned, float);
34
35         void set_depth_ratio(float);
36         void set_darkness(float);
37
38         virtual void render(Renderer &, const Texture2D &, const Texture2D &);
39 };
40
41 } // namespace GL
42 } // namespace Msp
43
44 #endif