40 #ifndef H_OGF_RENDERER_CONTEXT_AMBIENT_OCCLUSION_H
41 #define H_OGF_RENDERER_CONTEXT_AMBIENT_OCCLUSION_H
149 return nb_directions_;
199 step_mul_ = std::max(x,1.0);
260 GLfloat proj_inv_[16];
263 GLuint SSAO_program_;
268 GLuint blur_program_;
Implementation of AmbientOcclusion full screen effect.
double get_step_mul() const
Gets the multiplicative factor applied to each step when traversing from a pixel.
void resize(index_t w, index_t h) override
Callback called whenever the rendering context is resized.
void update() override
Callback called whenever parameters are changed in the GUI.
void set_blur_width(index_t x)
Sets the size of the blurring kernel.
void set_contrast(index_t x)
Sets the contrast.
double required_GLSL_version() const override
Gets the minimum required GLSL version needed to execute the shaders in this FullScreenEffectImpl.
index_t get_contrast() const
Gets the contrast.
void set_lightness(index_t x)
Sets the lightness.
double get_max_radius() const
Gets the maximum radius around a pixel where ambient occlusion is computed.
void get_proj_inv()
Gets the inverse of the projection transform.
void set_max_radius(double x)
Sets the maximum radius around a pixel where ambient occlusion is computed.
void display_final_texture()
Displays the final result.
index_t get_lightness() const
Gets the lightness.
void pre_render(index_t w, index_t h) override
Callback called at the beginning of each frame.
~AmbientOcclusionImpl() override
AmbientOcclusionImpl destructor.
void set_step_mul(double x)
Sets the multiplicative factor applied to each step when traversing from a pixel.
void compute_SSAO()
Computes the ambient occlusion in the blur_1_ FrameBufferObject, from the depth textures.
void set_nb_directions(index_t x)
Sets the number of directions.
void initialize(index_t w, index_t h) override
Callback called the first time this FullScreenEffectImpl is used.
void blur()
Applies a Gaussian blur to the (raw) ambient occlusion computed by apply_shader().
void post_render() override
Callback called at the end of each frame.
AmbientOcclusionImpl()
AmbientOcclusionImpl constructor.
index_t get_nb_directions() const
Gets the number of directions.
index_t get_blur_width() const
Gets the size of the blurring kernel.
void create_random_tex()
Creates a texture with random values in it.
An OpenGL frame buffer object.
Implementation of full screen effects.
Helper class for manipulating OpenGL frame buffer objects.
Common include file, providing basic definitions. Should be included before anything else by all head...
Low-level base class for full screen effects.
#define GEOGRAM_GFX_API
Linkage declaration for geogram symbols.
Global Vorpaline namespace.
void geo_clamp(T &x, T min, T max)
Clamps a value to a range.
geo_index_t index_t
The type for storing and manipulating indices.
SmartPointer< AmbientOcclusionImpl > AmbientOcclusionImpl_var
An automatic reference-counted pointer to an AmbientOcclusionImpl.