summaryrefslogtreecommitdiffstats
path: root/src/RenderConfigs.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/RenderConfigs.hpp')
-rw-r--r--src/RenderConfigs.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/RenderConfigs.hpp b/src/RenderConfigs.hpp
new file mode 100644
index 0000000..6279169
--- /dev/null
+++ b/src/RenderConfigs.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#include "Gal.hpp"
+
+class Gbuffer {
+ std::shared_ptr<Gal::Framebuffer> lightFramebuffer;
+ std::shared_ptr<Gal::Buffer> lightBuffer;
+ std::shared_ptr<Gal::Pipeline> lightPipeline;
+ std::shared_ptr<Gal::PipelineInstance> lightPipelineInstance;
+ std::shared_ptr<Gal::Texture> color;
+ std::shared_ptr<Gal::Texture> normal;
+ std::shared_ptr<Gal::Texture> depthStencil;
+ std::shared_ptr<Gal::Framebuffer> geomFramebuffer;
+
+ std::shared_ptr<Gal::Texture> finalColor;
+
+public:
+ Gbuffer(size_t geomW, size_t geomH, size_t lightW, size_t lightH);
+
+ std::shared_ptr<Gal::Framebuffer> GetGeometryTarget() {
+ return geomFramebuffer;
+ }
+
+ std::shared_ptr<Gal::Texture> GetFinalTexture() {
+ return finalColor;
+ }
+
+ void Render() {
+ lightPipeline->Activate();
+ lightPipelineInstance->Activate();
+ lightPipelineInstance->Render(0, 6);
+ }
+
+ void Clear() {
+ geomFramebuffer->Clear();
+ lightFramebuffer->Clear();
+ }
+};