Post Effect¶
-
struct
glen::PostEffect¶ Abstract post effect struct for doing 2D effects
Bloom¶
-
struct
glen::Bloom: public PostEffect¶ Create glow in bright areas.
Tone Map¶
-
struct
glen::ToneMap: public PostEffect¶ Tonemap HDR image.
Used to render information that would usually be outside the usual 0 to 1 range.
Public Functions
-
ToneMap(Framebuffer *backbuffer, const glm::uvec2 &dimensions)¶ Constructor.
- Parameters
backbuffer: SimpleFramebufferobject (e.g. `Framebuffer{ GL_FRAMEBUFFER }).dimensions: The dimensions of the window.
-
void
draw() override¶ Render the effect to screen.
-
Deferred¶
-
struct
glen::Deferred: public PostEffect¶ Struct for adding a deferred render stage to the primary renderer.
The deferred stage allows images to be rendered based on pre-passes containing data (e.g. normals, position etc.) intead of image output. This way the final render stage just needs to make calculations based off pixel data instead of 3D geometry.
Subclassed by AO_BlurDeferred, AO_GBufferDeferred, BlinnDeferred
Public Functions
-
Deferred(const GLenum target, Framebuffer *g_buffer, Material *material, const glm::uvec2 &dimensions)¶ Constructor.
- Parameters
target: The GL target to use (e.g.GL_TEXTURE_2D).g_buffer: TheFramebufferobject to use.material: TheMaterialto use. Should be specific G-Buffer material (AO_GBufferMaterialfor example).dimensions: The dimensions of the window.
-
~Deferred() = default¶
-
void
bind()¶ Ensure the
Framebufferassociated with this object is ‘active’ in relation to OpenGL.
-
void
unbind()¶ Unbind the
Framebuffer.
-
void
update_view(const CameraNode *camera_node)¶ Update the
Materialassociated with this object with the providedcamera_nodeinformation.
-
void
draw() override¶ Render to the screen.
-
glm::uvec2
dimensions()¶ - Return
Internal dimensions.
-
Framebuffer *
framebuffer()¶ - Return
The framebuffer object.
-
Texture *
texture(const GLuint g_buffer_loc)¶ - Return
The internal g-buffer texture at index
g_buffer_loc
-
void
set_target(const GLenum target)¶ Set the GL target (e.g.
GL_TEXTURE_2D).
-
void
set_dimensions(const glm::uvec2 &dimensions)¶ Set the screen dimensions to be used.
-
void
set_color_texture(const GLuint g_buffer_loc, Texture *texture)¶ Set a color g-buffer texture at index
g_buffer_loc
-
void
set_color_texture(const GLuint g_buffer_loc, Texture texture)¶ Set a color g-buffer texture at index
g_buffer_locand also store it in this object.
-
void
set_depth_texture(Texture texture)¶ Set the internal depth texture and also store it in this object.
-
void
send_color_textures_to_framebuffer()¶ Pass all color textures to the associated
Framebuffer
-
Blinn Deferred¶
-
struct
glen::BlinnDeferred: public Deferred¶ Used to render a blinn shader in deferred mode.
Public Functions
-
BlinnDeferred(const GLenum target, Framebuffer *g_buffer, const glm::uvec2 &dimensions)¶ Constructor.
- Parameters
target: GL target (e.g.GL_TEXTURE_2D).g_buffer: SimpleFramebufferobject (e.g.Framebuffer{ GL_FRAMEBUFFER }).dimensions: The dimensions of the window.
-
AO G-Buffer Deferred¶
-
struct
glen::AO_GBufferDeferred: public Deferred¶ Used to render ambient occlusion.
Public Functions
-
AO_GBufferDeferred(const GLenum target, Framebuffer *g_buffer, const glm::uvec2 &dimensions)¶ Constructor.
- Parameters
target: GL target (e.g.GL_TEXTURE_2D)g_buffer: SimpleFrmabufferobject (e.g.Framebuffer{ GL_FRAMEBUFFER })dimensions: The dimensions of the window.
-
AO Blur Deferred¶
-
struct
glen::AO_BlurDeferred: public Deferred¶ Used to render the second step in screen space ambient occlusion. The initial stage produces an image which is very grainy. This stage blurs the graininess to make the result look smoother on screen.
Public Functions
-
AO_BlurDeferred(const GLenum target, Framebuffer *g_buffer, const glm::uvec2 &dimensions)¶ Constructor.
- Parameters
target: GL target (e.g.GL_TEXTURE_2D)g_buffer: SimpleFrmabufferobject (e.g.Framebuffer{ GL_FRAMEBUFFER })dimensions: The dimensions of the window.
-