25 virtual void Resize(uint32_t width, uint32_t height)
override;
28 entt::registry& registry,
29 glm::mat4 projectionMatrix,
35 virtual uint16_t GetRenderModeCount()
const override;
36 virtual const RenderMode* GetRenderModes()
const override;
37 virtual void SetRenderMode(uint16_t mode)
override;
42 enum class DeferredRenderMode : uint16_t {
60 struct DeferredRendererImageSet {
101 std::vector<GraphicsAPI::RenderTarget*> bloomRenderTargets;
102 std::vector<GraphicsAPI::DescriptorSet*> bloomDescriptorSets;
105 std::map<Uuid, GraphicsAPI::GraphicsPipeline*> graphicsPipelineMap;
107 void CreatePipelines();
108 void CreateBloomUniformBuffers();
109 void UpdateBloomDescriptorSet(DeferredRendererImageSet& imageSet);
110 void CreateDepthOfFieldRenderTargetsAndDescriptorSets(DeferredRendererImageSet& imageSet,
size_t imageSetIndex);
111 void CreateSsrRenderTargetsAndDescriptorSets(DeferredRendererImageSet& imageSet,
size_t imageSetIndex);
112 void CreateBloomRenderTargetsAndDescriptorSets(DeferredRendererImageSet& imageSet,
size_t imageSetIndex);
116 void UpdateBloomUBO();
124 void CreateDepthOfFieldResources();
125 void CreateBloomResources();
126 void CreateSSRResources();
127 void CreateSsaoKernelAndNoise();
128 void CleanupPipelines();
129 void CreateDescriptorSetLayouts();
130 void CreateGbufferFramebuffer();
131 void CreateLitHDRFramebuffer();
132 void CreateDescriptorSets(DeferredRendererImageSet& imageSet);
133 void UpdateDescriptorSets(DeferredRendererImageSet& imageSet);
134 void CreateUniformBuffers();
135 void CreateVertexAndIndexBuffersAndLayouts();
137 struct PostProcessUbo {
138 glm::vec4 vignetteColor = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f);
139 float vignetteRadius = 0.75f;
140 float vignetteSoftness = 0.8f;
141 float grainAmount = 0.0007f;
142 float grainPixelSize = 1.0f;
143 glm::vec2 chromaticDistortionRedOffset = glm::vec2(0.00045f, 0.00045f);
144 glm::vec2 chromaticDistortionGreenOffset = glm::vec2(0.0003f, 0.0003f);
145 glm::vec2 chromaticDistortionBlueOffset = glm::vec2(-0.0003f, -0.0003f);
146 float paniniDistortionStrength = 0.0f;
147 bool isAnimated =
true;
150 PostProcessUbo postProcessUboData;
152 struct DebugUboData {
156 DebugUboData debugUboData;
158 uint32_t framebufferWidth = 0u;
159 uint32_t framebufferHeight = 0u;
160 uint32_t renderWidth = 0u;
161 uint32_t renderHeight = 0u;
163 size_t bloomStoredMipLevelCount = 0;
164 size_t bloomMipLevelCount = 0;
167 std::vector<DeferredRendererImageSet> deferredRendererImageSets;
168 std::vector<GraphicsAPI::UniformBuffer*> bloomUniformBuffers;
169 size_t bloomFirstUpsampleIndex = 0;
227 static std::array<Grindstone::BaseRenderer::RenderMode, static_cast<uint16_t>(DeferredRenderMode::Count)> renderModes;
230 Uuid currentEnvironmentMapUuid;
232 DeferredRenderMode renderMode;