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::render
9{
10 class FlatSkybox;
11 class CubicSkybox;
12 class Lighting;
13
15 {
16 oe::scene::Camera& camera;
17 oe::render::RenderManager& render_manager;
18 std::variant<CubicSkybox*, FlatSkybox*, std::nullptr_t> skybox = nullptr;
19 };
20
21 //using PipelineInput = PipelineInputData;
23
24 class Pipeline : public oe::util::Pipeline<PipelineInput, PipelineOutput>
25 {
26 public:
30 Pipeline() = default;
31
36 {
43
45 glm::ivec2 dimensions;
46
48 bool ssao_fixed_size = false;
49
51 uint32_t ssao_fixed_height = 600;
52
54 bool add_debug_render = false;
55
61 bool debug_render_flush = true;
62 };
63
71 Pipeline(const PbrOptions& options)
72 {
74 }
75
81
86
90 void setDimensions(const glm::ivec2& dimensions);
91
95 glm::ivec2 getDimensions() const noexcept;
96
101 std::shared_ptr<oe::render::Framebuffer> generateFramebuffer();
102
107 std::shared_ptr<oe::render::Framebuffer> generateFramebuffer(const glm::ivec2& size);
108
127
133 //void configureForPbrRendering(scene::Manager& scene_manager, const PbrOptions& options);
134
135 private:
136 glm::ivec2 _dimensions;
137 };
138
139 class Pass : public oe::util::pipeline::Handler<PipelineInput, PipelineOutput>
140 {
141 public:
142 Pass();
143
148
154 bool is_active = true;
155
156 protected:
157 std::shared_ptr<oe::render::ScreenQuad> _screen_quad;
158 };
159}
160
161#endif
Definition framebuffer.h:53
Lighting manager (rendering)
Definition lighting.h:34
Definition pipeline.h:140
Pipeline & getRenderPipeline()
Definition pipeline.h:25
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 &options)
Build an Pipeline for PBR rendering.
Definition pipeline.h:71
The "eye of the scene".
Definition camera.h:31
Definition pipeline.h:112
Render related abstractions (Shader, Framebuffer, Cubemaps, Textures)
Definition opengl.h:10
Oxygen Engine common namespace.
Definition debug.h:17
Generic render manager.
Definition manager.h:35
Definition pipeline.h:15
Options to use in Pipeline::configureForPbrRendering.
Definition pipeline.h:36
bool add_debug_render
Set to true to a debug pipe for displaying debug data.
Definition pipeline.h:54
bool ssao_fixed_size
Use a constant size buffer for SSAO instead of using one based on output buffer dimensions.
Definition pipeline.h:48
glm::ivec2 dimensions
Final framebuffer dimensions.
Definition pipeline.h:45
bool debug_render_flush
If the debug pipe is added, do we need to flush debug objects after rendering.
Definition pipeline.h:61
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:51
oe::render::Lighting * lighting_component
Lighting component of the scene.
Definition pipeline.h:42