Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
DeferredRendererCommon.hpp
1#ifndef _DEFERRED_RENDERER_COMMON_HPP
2#define _DEFERRED_RENDERER_COMMON_HPP
3
4#include <Common/HashedString.hpp>
5#include <Common/Graphics/Formats.hpp>
6#include <Common/Rendering/AttachmentInfo.hpp>
7
8const Grindstone::ConstHashedString mousePickRenderQueue("MousePick");
9const Grindstone::ConstHashedString editorRenderPassHashedString("Editor");
10const Grindstone::ConstHashedString gizmoRenderPassHashedString("Gizmo");
11
12static Grindstone::ConstHashedString selectionGeometryRenderPassKey = "SelectionSystem";
13static Grindstone::ConstHashedString gbufferRenderPassKey = "Gbuffer";
14static Grindstone::ConstHashedString geometryOpaqueRenderPassKey = "GeometryOpaque";
15static Grindstone::ConstHashedString geometryUnlitRenderPassKey = "GeometryUnlit";
16static Grindstone::ConstHashedString geometrySkyRenderPassKey = "GeometrySky";
17static Grindstone::ConstHashedString geometryTransparentRenderPassKey = "GeometryTransparent";
18static Grindstone::ConstHashedString mainRenderPassKey = "Main";
19
20static Grindstone::ConstHashedString dofSeparationRenderPassKey = "DofSeparation";
21static Grindstone::ConstHashedString dofBlurAndCombinationRenderPassKey = "DofBlurAndCombination";
22
23static Grindstone::ConstHashedString lightingRenderPassKey = "Lighting";
24static Grindstone::ConstHashedString forwardLitRenderPassKey = "ForwardLit";
25static Grindstone::ConstHashedString ssaoRenderPassKey = "Ssao";
26static Grindstone::ConstHashedString ssaoBlurRenderPassKey = "Ssao Blur";
27static Grindstone::ConstHashedString shadowMapRenderPassKey = "ShadowMap";
28
29static const Grindstone::GraphicsAPI::Format depthFormat = Grindstone::GraphicsAPI::Format::D32_SFLOAT;
30static const Grindstone::GraphicsAPI::Format litHdrFormat = Grindstone::GraphicsAPI::Format::R16G16B16A16_SFLOAT;
31static const Grindstone::GraphicsAPI::Format ambientOcclusionFormat = Grindstone::GraphicsAPI::Format::R8_UNORM;
32
33static Grindstone::ConstHashedString attachmentNameAlbedo = "Grindstone.Gbuffer.Albedo";
34static Grindstone::ConstHashedString attachmentNameNormal = "Grindstone.Gbuffer.Normal";
35static Grindstone::ConstHashedString attachmentNameSpecularRoughness = "Grindstone.Gbuffer.SpecularRoughness";
36static Grindstone::ConstHashedString attachmentNameDepthStencil = "Grindstone.Gbuffer.DepthStencil";
37static Grindstone::ConstHashedString attachmentNameLighting = "Grindstone.Lighting";
38static Grindstone::ConstHashedString attachmentNameShadowDepthStencil = "Grindstone.ShadowAtlas";
39static Grindstone::ConstHashedString attachmentNameOutput = "Grindstone.Renderer.Output";
40
41static Grindstone::Renderer::ImageDescription attachmentAlbedo{ .name = "Gbuffer Albedo", .format = Grindstone::GraphicsAPI::Format::R8G8B8A8_UNORM, .imageUsage = Grindstone::GraphicsAPI::ImageUsageFlags::RenderTarget | Grindstone::GraphicsAPI::ImageUsageFlags::Sampled};
42static Grindstone::Renderer::ImageDescription attachmentNormal{ .name = "Gbuffer Normal", .format = Grindstone::GraphicsAPI::Format::R16G16B16A16_SNORM, .imageUsage = Grindstone::GraphicsAPI::ImageUsageFlags::RenderTarget | Grindstone::GraphicsAPI::ImageUsageFlags::Sampled };
43static Grindstone::Renderer::ImageDescription attachmentSpecularRoughness{ .name = "Gbuffer Specular / Roughness", .format = Grindstone::GraphicsAPI::Format::R8G8B8A8_UNORM, .imageUsage = Grindstone::GraphicsAPI::ImageUsageFlags::RenderTarget | Grindstone::GraphicsAPI::ImageUsageFlags::Sampled };
44static Grindstone::Renderer::ImageDescription attachmentDepthStencil{ .name = "Gbuffer Depth Stencil", .format = depthFormat, .imageUsage = Grindstone::GraphicsAPI::ImageUsageFlags::DepthStencil | Grindstone::GraphicsAPI::ImageUsageFlags::Sampled };
45static Grindstone::Renderer::ImageDescription attachmentlighting{ .name = "Lighting Buffer", .format = litHdrFormat, .imageUsage = Grindstone::GraphicsAPI::ImageUsageFlags::RenderTarget | Grindstone::GraphicsAPI::ImageUsageFlags::Sampled };
46static Grindstone::Renderer::ImageDescription attachmentOutput{ .name = "Output Attachment", .format = Grindstone::GraphicsAPI::Format::R8G8B8A8_UNORM, .imageUsage = Grindstone::GraphicsAPI::ImageUsageFlags::TransferSrc | Grindstone::GraphicsAPI::ImageUsageFlags::RenderTarget | Grindstone::GraphicsAPI::ImageUsageFlags::Sampled };
47
48static const uint32_t shadowAtlasResolution = 4096u;
49static Grindstone::Renderer::ImageDescription attachmentShadowDepthStencil{
50 .name = "Shadow Depth Stencil",
51 .size = Grindstone::Renderer::MetaSize2D{shadowAtlasResolution, shadowAtlasResolution},
52 .format = depthFormat,
53 .imageUsage = Grindstone::GraphicsAPI::ImageUsageFlags::DepthStencil | Grindstone::GraphicsAPI::ImageUsageFlags::Sampled
54};
55
57
58#endif
Definition HashedString.hpp:54
Definition AttachmentInfo.hpp:228
Definition AttachmentInfo.hpp:102