Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
pipeline.h
1#ifndef OE_RENDER_PIPELINE
2#define OE_RENDER_PIPELINE
3
4#include "manager.h"
5#include "../util/pipeline.h"
6#include "screen_quad.h"
7
8namespace oe::component
9{
10 class Lighting;
11}
12
13namespace oe::render
14{
15 typedef oe::render::Manager& PipelineInput;
16 typedef oe::render::Framebuffer* PipelineOutput;
17
18 class Pipeline : public oe::util::Pipeline<PipelineInput, PipelineOutput>
19 {
20 public:
24 Pipeline() = default;
25
30 {
37
39 glm::ivec2 dimensions;
40
42 bool ssao_fixed_size = false;
43
45 uint32_t ssao_fixed_height = 600;
46
48 bool add_debug_render = false;
49
55 bool debug_render_flush = true;
56 };
57
66
72
77
81 void setDimensions(const glm::ivec2& dimensions);
82
86 glm::ivec2 getDimensions() const noexcept;
87
92 std::shared_ptr<oe::render::Framebuffer> generateFramebuffer();
93
98 std::shared_ptr<oe::render::Framebuffer> generateFramebuffer(const glm::ivec2& size);
99
118
124 void configureForPbrRendering(scene::Manager& scene_manager, const PbrOptions& options);
125
126 private:
127 glm::ivec2 _dimensions;
128 };
129
130 class Pass : public oe::util::pipeline::Handler<PipelineInput, PipelineOutput>
131 {
132 public:
133 Pass();
134
139
145 bool is_active = true;
146
147 protected:
148 std::shared_ptr<oe::render::ScreenQuad> _screen_quad;
149 };
150}
151
152#endif
Lighting component.
Definition lighting.h:39
Definition framebuffer.h:43
Render manager.
Definition manager.h:22
Definition pipeline.h:131
Pipeline & getRenderPipeline()
Definition pipeline.h:19
void setDimensions(const glm::ivec2 &dimensions)
Set the final framebuffer dimensions.
oe::render::Framebuffer & getResultFramebuffer()
Get the final framebuffer which be written by the pipeline.
std::shared_ptr< oe::render::Framebuffer > generateFramebuffer()
Generate a framebuffer for postprocessing effects.
void setResultFramebuffer(oe::render::Framebuffer &target)
Set the final framebuffer which be written by the pipeline.
Pipeline()=default
Build an empty rendering Pipeline.
void configureForPbrRendering(const PbrOptions &options)
Initialize the pipeline to act as a complete render pipeline ready for PBR rendering.
glm::ivec2 getDimensions() const noexcept
Get the final framebuffer dimensions.
Pipeline(const PbrOptions &)
Build an Pipeline for PBR rendering.
Definition pipeline.h:105
Scene / node components (camera, lighting, ...)
Definition pipeline.h:9
Render related abstractions (Shader, Framebuffer, Cubemaps, Textures)
Definition opengl.h:10
Oxygen Engine common namespace.
Definition cursor.h:8
Options to use in Pipeline::configureForPbrRendering.
Definition pipeline.h:30
bool add_debug_render
Set to true to a debug pipe for displaying debug data.
Definition pipeline.h:48
oe::component::Lighting * lighting_component
Lighting component of the scene.
Definition pipeline.h:36
bool ssao_fixed_size
Use a constant size buffer for SSAO instead of using one based on output buffer dimensions.
Definition pipeline.h:42
glm::ivec2 dimensions
Final framebuffer dimensions.
Definition pipeline.h:39
bool debug_render_flush
If the debug pipe is added, do we need to flush debug objects after rendering.
Definition pipeline.h:55
uint32_t ssao_fixed_height
When using a constant size buffer for SSAO, this is the default height. Width is computed based on fr...
Definition pipeline.h:45