Antkeeper  0.0.1
Public Member Functions | List of all members
render::bloom_pass Class Reference

Physically-based bloom render pass. More...

#include <bloom-pass.hpp>

Inheritance diagram for render::bloom_pass:
render::pass

Public Member Functions

 bloom_pass (gl::pipeline *pipeline, resource_manager *resource_manager)
 Constructs a bloom pass. More...
 
void render (render::context &ctx) override
 Renders a bloom texture. More...
 
void resize ()
 Resizes the mip chain resolution according to the resolution of the source texture. More...
 
void set_source_texture (std::shared_ptr< gl::texture_2d > texture)
 Sets the bloom source texture. More...
 
void set_mip_chain_length (unsigned int length)
 Sets the mip chain length. More...
 
void set_filter_radius (float radius)
 Sets the upsample filter radius. More...
 
std::shared_ptr< gl::texture_2dget_bloom_texture () const
 Returns the texture containing the bloom result. More...
 
- Public Member Functions inherited from render::pass
 pass (gl::pipeline *pipeline, const gl::framebuffer *framebuffer)
 
virtual ~pass ()
 
void set_enabled (bool enabled)
 
constexpr bool is_enabled () const noexcept
 
void set_framebuffer (const gl::framebuffer *framebuffer)
 
void set_clear_mask (std::uint8_t mask) noexcept
 
void set_clear_value (const gl::clear_value &value) noexcept
 
void clear ()
 

Additional Inherited Members

- Protected Attributes inherited from render::pass
gl::pipelinem_pipeline
 
const gl::framebufferm_framebuffer
 
std::uint8_t m_clear_mask {}
 
gl::clear_value m_clear_value
 

Detailed Description

Physically-based bloom render pass.

See also
Jimenez, J. (2014). Next generation post processing in call of duty advanced warfare. SIGGRAPH Advances in Real-Time Rendering.
https://learnopengl.com/Guest-Articles/2022/Phys.-Based-Bloom

Definition at line 44 of file bloom-pass.hpp.

Constructor & Destructor Documentation

◆ bloom_pass()

render::bloom_pass::bloom_pass ( gl::pipeline pipeline,
resource_manager resource_manager 
)

Constructs a bloom pass.

Parameters
pipelineGraphics pipeline.
resource_managerResource manager.

Definition at line 36 of file bloom-pass.cpp.

Member Function Documentation

◆ get_bloom_texture()

std::shared_ptr<gl::texture_2d> render::bloom_pass::get_bloom_texture ( ) const
inline

Returns the texture containing the bloom result.

Definition at line 92 of file bloom-pass.hpp.

◆ render()

void render::bloom_pass::render ( render::context ctx)
overridevirtual

Renders a bloom texture.

Parameters
ctxRender context.
queueRender queue.

Implements render::pass.

Definition at line 73 of file bloom-pass.cpp.

◆ resize()

void render::bloom_pass::resize ( )

Resizes the mip chain resolution according to the resolution of the source texture.

◆ set_filter_radius()

void render::bloom_pass::set_filter_radius ( float  radius)

Sets the upsample filter radius.

Parameters
radiusUpsample filter radius, in texture coordinates.

Definition at line 101 of file bloom-pass.cpp.

◆ set_mip_chain_length()

void render::bloom_pass::set_mip_chain_length ( unsigned int  length)

Sets the mip chain length.

A length of 1 indicates a single stage bloom.

Parameters
lengthMip chain length.

Definition at line 94 of file bloom-pass.cpp.

◆ set_source_texture()

void render::bloom_pass::set_source_texture ( std::shared_ptr< gl::texture_2d texture)

Sets the bloom source texture.

Parameters
textureBloom source texture.

Definition at line 82 of file bloom-pass.cpp.


The documentation for this class was generated from the following files: