Geogram
Version 1.9.1
A programming library of geometric algorithms
|
Implementation of full screen effects. More...
#include <geogram_gfx/full_screen_effects/full_screen_effect.h>
Public Member Functions | |
FullScreenEffectImpl () | |
FullScreenEffectImpl constructor. | |
~FullScreenEffectImpl () override | |
FullScreenEffectImpl destructor. | |
virtual double | required_GLSL_version () const |
Gets the minimum required GLSL version needed to execute the shaders in this FullScreenEffectImpl. More... | |
virtual void | pre_render (index_t width, index_t height) |
Callback called at the beginning of each frame. More... | |
virtual void | post_render () |
Callback called at the end of each frame. More... | |
virtual void | update () |
Callback called whenever parameters are changed in the GUI. More... | |
index_t | width () const |
Gets the width of the rendering context. More... | |
index_t | height () const |
Gets the height of the rendering context. More... | |
bool | OK () const |
Tests whether this FullScreenEffect can be used. More... | |
virtual void | get_vertex_shader_preamble_pseudo_file (std::vector< GLSL::Source > &sources) |
Gets the content of the virtual file GLUP/current_profile/vertex_shader_preamble.h. More... | |
virtual void | get_fragment_shader_preamble_pseudo_file (std::vector< GLSL::Source > &sources) |
Gets the content of the virtual file GLUP/current_profile/fragment_shader_preamble.h. More... | |
Public Member Functions inherited from GEO::Counted | |
void | ref () const |
Increments the reference count. More... | |
void | unref () const |
Decrements the reference count. More... | |
bool | is_shared () const |
Check if the object is shared. More... | |
int | nb_refs () const |
Gets the number of references that point to this object. More... | |
Public Member Functions inherited from GEO::GLSL::PseudoFileProvider | |
virtual | ~PseudoFileProvider () |
PseudoFileProvider destructor. | |
Protected Member Functions | |
virtual void | initialize (index_t w, index_t h) |
Callback called the first time this FullScreenEffectImpl is used. More... | |
virtual void | resize (index_t w, index_t h) |
Callback called whenever the rendering context is resized. More... | |
void | reset_alpha () |
Resets alpha plane to 1.0 (opaque) | |
Protected Member Functions inherited from GEO::Counted | |
Counted () | |
Creates a reference counted object. More... | |
virtual | ~Counted () |
Destroys a reference counted object. More... | |
Protected Attributes | |
FrameBufferObject | draw_FBO_ |
bool | ES_profile_ |
Additional Inherited Members | |
Static Public Member Functions inherited from GEO::Counted | |
static void | ref (const Counted *counted) |
Increments the reference count. More... | |
static void | unref (const Counted *counted) |
Decrements the reference count. More... | |
Implementation of full screen effects.
This is the low-level class for full screen effects, that communicates with the RenderingContext and with OpenGL. In Graphite, typically a full screen effect is implemented as a pair of FullScreenEffectImpl / FullScreenEffect.
Definition at line 63 of file full_screen_effect.h.
|
virtual |
Gets the content of the virtual file GLUP/current_profile/fragment_shader_preamble.h.
[in,out] | sources | where the content of the virtual file should be appended |
|
virtual |
Gets the content of the virtual file GLUP/current_profile/vertex_shader_preamble.h.
[in,out] | sources | where the content of the virtual file should be appended |
|
inline |
Gets the height of the rendering context.
We cache the size of the rendering context, it is used for instance to create FrameBufferObjects.
Definition at line 127 of file full_screen_effect.h.
Callback called the first time this FullScreenEffectImpl is used.
[in] | w,h | width and height of the rendering context. |
Subclasses may overload this callback. The OpenGL context is properly bound when this function is called.
Reimplemented in GEO::UnsharpMaskingImpl, and GEO::AmbientOcclusionImpl.
|
inline |
Tests whether this FullScreenEffect can be used.
Most full screen effects require some hardware support, this function tests whether the GPU has sufficient functionalities for implementing this FullScreenEffect.
true | if it can be used |
false | otherwise |
Definition at line 139 of file full_screen_effect.h.
|
virtual |
Callback called at the end of each frame.
Subclasses may overload this function, and use it to transfered the content of FrameBufferObjects to the screen. Baseclass implementation copies the contents of draw_FBO_ to the screen.
Reimplemented in GEO::UnsharpMaskingImpl, and GEO::AmbientOcclusionImpl.
Callback called at the beginning of each frame.
[in] | width,height | dimension of the rendering context. |
Baseclass implementation redirects rendering to draw_FBO_.
Reimplemented in GEO::UnsharpMaskingImpl, and GEO::AmbientOcclusionImpl.
|
virtual |
Gets the minimum required GLSL version needed to execute the shaders in this FullScreenEffectImpl.
Default implementation returns 1.0.
Reimplemented in GEO::UnsharpMaskingImpl, and GEO::AmbientOcclusionImpl.
Callback called whenever the rendering context is resized.
Subclasses may overload this callback, for instance to resize FrameBufferObject.
[in] | w,h | new width and height of the rendering context, in pixels. |
Reimplemented in GEO::UnsharpMaskingImpl, and GEO::AmbientOcclusionImpl.
|
virtual |
Callback called whenever parameters are changed in the GUI.
Subclasses may overload this function, and use it to transfer parameters to shader uniforms.
Reimplemented in GEO::UnsharpMaskingImpl, and GEO::AmbientOcclusionImpl.
|
inline |
Gets the width of the rendering context.
We cache the size of the rendering context, it is used for instance to create FrameBufferObjects.
Definition at line 117 of file full_screen_effect.h.