Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
Bloom.hpp
1#pragma once
2
3#include <Common/Rendering/RendererFeature.hpp>
4#include <Common/Rendering/RenderGraphBuilder.hpp>
5#include <EngineCore/Assets/AssetReference.hpp>
6#include <EngineCore/Assets/PipelineSet/ComputePipelineAsset.hpp>
7
8namespace Grindstone::Renderer {
9 class Bloom : public Rendering::RendererFeature {
10 public:
11 Bloom() : Rendering::RendererFeature("Bloom", Rendering::DeferredRenderGraphOrderEvent::Bloom) {}
12 static const char* GetStaticFeatureName() { return "Bloom"; }
13 virtual void Initialize() override;
14 virtual void Bind(
17 ) override;
18
19 static const size_t BLOOM_MIPS = 4u;
20 static const size_t BLOOM_STAGE_COUNT = BLOOM_MIPS * 2u;
21
22 struct ImageSet {
23 std::array<Grindstone::GraphicsAPI::DescriptorSet*, BLOOM_STAGE_COUNT> descriptorSets{};
24 std::array<Grindstone::GraphicsAPI::Buffer*, BLOOM_STAGE_COUNT> bloomStageBuffers{};
25 Grindstone::GraphicsAPI::Buffer* bloomDataBuffer{};
26 Grindstone::Math::Uint2 size;
27 };
28
29 private:
30 void CreateDescriptorSets();
31 void UpdateBloomUBO();
32 void CreateBloomResources();
33 void UpdateBloomDescriptorSet();
34 void CreateUniformBuffers();
36 Grindstone::GraphicsAPI::DescriptorSetLayout* descriptorSetLayout = nullptr;
37 Grindstone::GraphicsAPI::Sampler* screenSampler = nullptr;
38
39 std::array<ImageSet, 3> imageSets;
40 };
41}
Definition Buffer.hpp:49
Definition DescriptorSetLayout.hpp:14
Definition Sampler.hpp:49
Definition RenderGraphBuilder.hpp:12
Definition RendererFeature.hpp:10
Definition AttachmentInfo.hpp:17
Definition AssetReference.hpp:45
Definition RenderFrameContext.hpp:24