X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Feffects%2Fambientocclusion.h;h=fd3b6574cbbdfec1b83b2244d1e5e744cf003532;hb=a313d4a1050815d987f855cafaea046dba158625;hp=6c2c5d7eea938daa6be0e6e5ce2387dd2a361660;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/effects/ambientocclusion.h b/source/effects/ambientocclusion.h index 6c2c5d7e..fd3b6574 100644 --- a/source/effects/ambientocclusion.h +++ b/source/effects/ambientocclusion.h @@ -1,18 +1,15 @@ #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" -#include "texturing.h" namespace Msp { namespace GL { +class Program; + /** Implements screen-space ambient occlusion. @@ -40,21 +37,22 @@ public: }; private: - Texture2D rotate_lookup; + const Texture2D &rotate_lookup; RenderTarget occlude_target; - Texturing texturing; - Program occlude_shader; - Program combine_shader; + const Program &occlude_shader; + const Program &combine_shader; mutable ProgramData shdata; - RefPtr quad; - RefPtr linear_sampler; - RefPtr nearest_sampler; + const Mesh &quad; + const Sampler &linear_sampler; + const Sampler &nearest_clamp_sampler; + const Sampler &nearest_sampler; public: AmbientOcclusion(unsigned, unsigned, float = 1.0f); private: - static float random(unsigned &); + static const Texture2D &get_or_create_rotate_lookup(); + static float radical_inverse(unsigned); public: void set_n_samples(unsigned); @@ -64,6 +62,8 @@ public: void set_darkness(float); virtual void render(Renderer &, const Texture2D &, const Texture2D &); + + virtual void set_debug_name(const std::string &); }; } // namespace GL