Class Renderer
Forward declaration — see app/Window.h .More...
#include <Renderer.h>
Public Attributes
| Type | Name |
|---|---|
| std::vector< FrameBuffer > | r_buffer_list List of intermediate framebuffers (to be centralized) |
| RenderConfigs | r_config Render configuration (should use RenderContext ) |
| GLuint | r_frame_height = {}Current frame height (to be moved to RenderContext ) |
| GLuint | r_frame_width = {}Current frame width (to be moved to RenderContext ) |
| bool | r_is_preview = trueWhether in preview mode (editor-specific) |
| bool | r_render_icons = trueWhether to render UI icons (editor-specific) |
| ShadowSystem | r_shadow_system Shadow system managing light GPU buffers and shadow map caching. |
Public Static Attributes
| Type | Name |
|---|---|
| GLint | max_resolution_h = 0Maximum supported framebuffer height. |
| GLint | max_resolution_w = 0Maximum supported framebuffer width. |
Public Functions
| Type | Name |
|---|---|
| void | BindFrameBuffer (int slot) Binds a framebuffer at the specified slot. |
| void | ConstructSDF (const Context & ctx) Constructs SDF (Signed Distance Field ) for soft shadows. |
| void | EndFrameBuffer (int slot) Unbinds a framebuffer at the specified slot. |
| RenderConfigs * | GetConfig () Returns pointer to render configuration. |
| FrameBuffer * | GetFrameBufferPtr () Returns pointer to the main render result framebuffer. |
| void | InitFrameBuffer () Initializes all framebuffers for the rendering pipeline. |
| void | NewFrame () Prepares for a new frame by clearing buffers. |
| void | Render (const Context & ctx, bool rend=true, bool buff=true) Executes the full rendering pipeline. |
| Renderer (EventPool & evt, Window & w) Constructs and fully initializes the renderer. |
|
| Renderer (const Renderer &) = delete |
|
| void | Reset () Resets renderer state to initial configuration. |
| void | ScreenShot () Saves the current frame to a screenshot file. |
| Renderer & | operator= (const Renderer &) = delete |
| ~Renderer () Destroys the renderer and releases all GPU resources. |
Detailed Description
OpenGL 4.6 renderer providing real-time rendering pipeline.
Renderer executes a multi-pass deferred rendering pipeline with PBR lighting, IBL, shadows, post-processing, and anti-aliasing. It manages GPU resources (framebuffers, shaders, buffers) and ensures deterministic cleanup.
Rendering Pipeline: * Geometry pass (G-Buffer: position, normal, albedo, metallic/roughness) * Lighting pass (PBR evaluation with multi-light support) * IBL pass (environment maps for diffuse/specular) * Post-processing (SSAO, SSR, shadows, FXAA) * Composite to final framebuffer
Note:
Ownership: Renderer owns all GPU resources and releases them in destructor.
Note:
Thread-safety: Not thread-safe. Must be used from OpenGL context thread.
Public Attributes Documentation
variable r_buffer_list
List of intermediate framebuffers (to be centralized)
std::vector<FrameBuffer> Renderer::r_buffer_list;
variable r_config
Render configuration (should use RenderContext )
RenderConfigs Renderer::r_config;
variable r_frame_height
Current frame height (to be moved to RenderContext )
GLuint Renderer::r_frame_height;
variable r_frame_width
Current frame width (to be moved to RenderContext )
GLuint Renderer::r_frame_width;
variable r_is_preview
Whether in preview mode (editor-specific)
bool Renderer::r_is_preview;
variable r_render_icons
Whether to render UI icons (editor-specific)
bool Renderer::r_render_icons;
variable r_shadow_system
Shadow system managing light GPU buffers and shadow map caching.
ShadowSystem Renderer::r_shadow_system;
Public Static Attributes Documentation
variable max_resolution_h
Maximum supported framebuffer height.
GLint Renderer::max_resolution_h;
variable max_resolution_w
Maximum supported framebuffer width.
GLint Renderer::max_resolution_w;
Public Functions Documentation
function BindFrameBuffer
Binds a framebuffer at the specified slot.
void Renderer::BindFrameBuffer (
int slot
)
Parameters:
slotFramebuffer slot index
function ConstructSDF
Constructs SDF (Signed Distance Field ) for soft shadows.
void Renderer::ConstructSDF (
const Context & ctx
)
Builds a volumetric SDF from scene geometry for use in SDF-based soft shadow algorithms.
Parameters:
ctxContext providing scene geometry
Note:
Performance: SDF construction is expensive. Cache when possible.
function EndFrameBuffer
Unbinds a framebuffer at the specified slot.
void Renderer::EndFrameBuffer (
int slot
)
Parameters:
slotFramebuffer slot index
function GetConfig
Returns pointer to render configuration.
inline RenderConfigs * Renderer::GetConfig ()
Returns:
Non-owning pointer to RenderConfigs
function GetFrameBufferPtr
Returns pointer to the main render result framebuffer.
inline FrameBuffer * Renderer::GetFrameBufferPtr ()
Returns:
Non-owning pointer to result FrameBuffer
function InitFrameBuffer
Initializes all framebuffers for the rendering pipeline.
void Renderer::InitFrameBuffer ()
Note:
Called during Renderer initialization
function NewFrame
Prepares for a new frame by clearing buffers.
void Renderer::NewFrame ()
Note:
Call before Render() each frame
function Render
Executes the full rendering pipeline.
void Renderer::Render (
const Context & ctx,
bool rend=true,
bool buff=true
)
Renders the scene from the active camera using multi-pass deferred rendering. Reads immutable scene data from Context and applies RenderConfigs settings.
Parameters:
ctxContext providing read-only scene accessrendEnable rasterization pass (default: true)buffEnable buffer outputs (default: true)
Note:
This is the primary rendering entry point
Note:
Context must not be mutated during or after this call
function Renderer [1/2]
Constructs and fully initializes the renderer.
Renderer::Renderer (
EventPool & evt,
Window & w
)
Takes Window& to enforce that steps 1–3 of the required initialization sequence (glfwInit, glfwCreateWindow, glfwMakeContextCurrent) have already completed. Sets glewExperimental, calls glewInit, configures OpenGL state, initializes framebuffers and shadow system, and subscribes to events.
Parameters:
evtEventPool for subscribing to viewport resize and other eventswActive Window — proves the OpenGL context is current
function Renderer [2/2]
Renderer::Renderer (
const Renderer &
) = delete
function Reset
Resets renderer state to initial configuration.
void Renderer::Reset ()
Note:
Useful for clearing accumulated state between scenes
function ScreenShot
Saves the current frame to a screenshot file.
void Renderer::ScreenShot ()
Note:
File format and path are determined internally
function operator=
Renderer & Renderer::operator= (
const Renderer &
) = delete
function ~Renderer
Destroys the renderer and releases all GPU resources.
Renderer::~Renderer ()
Note:
All OpenGL objects are deleted deterministically
The documentation for this class was generated from the following file src/render/Renderer.h