X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Feffects%2Fambientocclusion.h;h=d055c6851e1aa362c4aaab1ea2fb8a3c91ef5662;hb=7ab8bc0724f40b46d7f5da1bcb05ab6d0cecbb43;hp=f186db3dcd073a9577d20d44d68c6bd6f9d8185f;hpb=7f81f26889b84542b0b35685b0e80383256cdc47;p=libs%2Fgl.git diff --git a/source/effects/ambientocclusion.h b/source/effects/ambientocclusion.h index f186db3d..d055c685 100644 --- a/source/effects/ambientocclusion.h +++ b/source/effects/ambientocclusion.h @@ -1,19 +1,17 @@ #ifndef MSP_GL_AMBIENTOCCLUSION_H_ #define MSP_GL_AMBIENTOCCLUSION_H_ -#include "framebuffer.h" -#include "mesh.h" #include "postprocessor.h" -#include "program.h" #include "programdata.h" #include "rendertarget.h" -#include "texture2d.h" namespace Msp { namespace GL { +class Program; + /** -Implements screen-space ambient occlusion. +Darkens recessed areas of the scene to simulate the occlusion of ambient light. http://en.wikipedia.org/wiki/Screen_Space_Ambient_Occlusion */ @@ -28,12 +26,10 @@ public: Loader(Template &); }; - unsigned n_samples; - float occlusion_radius; - float darkness; - float edge_depth_threshold; - - Template(); + unsigned n_samples = 16; + float occlusion_radius = 0.5f; + float darkness = 1.0f; + float edge_depth_threshold = 0.1f; virtual AmbientOcclusion *create(unsigned, unsigned) const; }; @@ -50,7 +46,7 @@ private: const Sampler &nearest_sampler; public: - AmbientOcclusion(unsigned, unsigned, float = 1.0f); + AmbientOcclusion(unsigned, unsigned); private: static const Texture2D &get_or_create_rotate_lookup(); @@ -64,6 +60,8 @@ public: void set_darkness(float); virtual void render(Renderer &, const Texture2D &, const Texture2D &); + + virtual void set_debug_name(const std::string &); }; } // namespace GL