Files
Seele/src/Engine/Graphics/RenderPass/BasePass.h
T

79 lines
2.4 KiB
C++
Raw Normal View History

2020-06-02 11:46:18 +02:00
#pragma once
#include "MinimalEngine.h"
2021-05-06 17:02:10 +02:00
#include "RenderPass.h"
2020-06-02 11:46:18 +02:00
2024-06-09 12:20:04 +02:00
namespace Seele {
2021-04-01 16:40:14 +02:00
DECLARE_REF(CameraActor)
2024-06-09 12:20:04 +02:00
class BasePass : public RenderPass {
public:
2023-10-24 15:01:09 +02:00
BasePass(Gfx::PGraphics graphics, PScene scene);
2023-11-05 10:36:01 +01:00
BasePass(BasePass&&) = default;
BasePass& operator=(BasePass&&) = default;
2021-05-06 17:02:10 +02:00
virtual ~BasePass();
2022-11-17 16:47:42 +01:00
virtual void beginFrame(const Component::Camera& cam) override;
2022-04-15 23:45:44 +02:00
virtual void render() override;
virtual void endFrame() override;
2021-05-06 17:02:10 +02:00
virtual void publishOutputs() override;
virtual void createRenderPass() override;
2024-06-09 12:20:04 +02:00
private:
2024-07-05 12:02:46 +02:00
Gfx::RenderTargetAttachment msColorAttachment;
2024-02-01 10:21:36 +01:00
Gfx::RenderTargetAttachment colorAttachment;
2024-07-05 12:02:46 +02:00
Gfx::RenderTargetAttachment msDepthAttachment;
2024-02-01 10:21:36 +01:00
Gfx::RenderTargetAttachment depthAttachment;
2024-05-30 16:56:22 +02:00
Gfx::RenderTargetAttachment visibilityAttachment;
2023-11-05 10:36:01 +01:00
Gfx::PShaderBuffer oLightIndexList;
Gfx::PShaderBuffer tLightIndexList;
Gfx::PTexture2D oLightGrid;
Gfx::PTexture2D tLightGrid;
2024-06-09 12:20:04 +02:00
2024-02-21 10:30:04 +01:00
Gfx::PDescriptorSet opaqueCulling;
Gfx::PDescriptorSet transparentCulling;
2024-05-09 08:41:46 +02:00
2024-06-11 14:15:29 +02:00
// use a different texture here so we can do multisampling
2024-07-05 12:02:46 +02:00
Gfx::OTexture2D msBasePassDepth;
2024-06-11 14:15:29 +02:00
Gfx::OTexture2D basePassDepth;
2024-07-05 12:02:46 +02:00
Gfx::OTexture2D msBasePassColor;
2024-06-11 14:15:29 +02:00
2024-06-20 21:57:26 +02:00
// used for transparency sorting
Vector cameraPos;
Vector cameraForward;
PCameraActor source;
2023-11-01 23:12:30 +01:00
Gfx::OPipelineLayout basePassLayout;
2023-11-05 10:36:01 +01:00
Gfx::ODescriptorLayout lightCullingLayout;
2024-06-07 09:19:47 +02:00
2024-06-15 21:47:20 +02:00
Gfx::OPipelineStatisticsQuery query;
2024-07-01 12:17:04 +02:00
Gfx::PTimestampQuery timestamps;
2024-06-15 21:47:20 +02:00
2024-06-07 09:19:47 +02:00
Gfx::PShaderBuffer cullingBuffer;
2024-07-05 12:02:46 +02:00
// Debug rendering
Gfx::OVertexInput debugVertexInput;
Gfx::OVertexBuffer debugVertices;
Gfx::OVertexShader debugVertexShader;
Gfx::OFragmentShader debugFragmentShader;
Gfx::PGraphicsPipeline debugPipeline;
Gfx::OPipelineLayout debugPipelineLayout;
// Skybox
Gfx::ODescriptorLayout skyboxDataLayout;
Gfx::PDescriptorSet skyboxDataSet;
Gfx::ODescriptorLayout textureLayout;
Gfx::PDescriptorSet textureSet;
Gfx::OVertexShader vertexShader;
Gfx::OFragmentShader fragmentShader;
Gfx::OPipelineLayout pipelineLayout;
Gfx::PGraphicsPipeline pipeline;
Gfx::OSampler skyboxSampler;
struct SkyboxData {
Matrix4 transformMatrix;
Vector fogColor;
float blendFactor;
} skyboxData;
Gfx::OUniformBuffer skyboxBuffer;
Component::Skybox skybox;
2020-06-02 11:46:18 +02:00
};
2021-04-01 16:40:14 +02:00
DEFINE_REF(BasePass)
2020-06-02 11:46:18 +02:00
} // namespace Seele