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

50 lines
1.7 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
namespace Seele
{
2021-04-01 16:40:14 +02:00
DECLARE_REF(CameraActor)
2023-10-24 15:01:09 +02:00
class BasePass : public RenderPass
2020-06-02 11:46:18 +02:00
{
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;
static void modifyRenderPassMacros(Map<const char*, const char*>& defines);
2020-06-02 11:46:18 +02:00
private:
2024-02-01 10:21:36 +01:00
Gfx::RenderTargetAttachment colorAttachment;
Gfx::RenderTargetAttachment depthAttachment;
2023-11-05 10:36:01 +01:00
Gfx::PShaderBuffer oLightIndexList;
Gfx::PShaderBuffer tLightIndexList;
Gfx::PTexture2D oLightGrid;
Gfx::PTexture2D tLightGrid;
2021-09-23 10:10:39 +02:00
2024-02-21 10:30:04 +01:00
Gfx::PDescriptorSet opaqueCulling;
Gfx::PDescriptorSet transparentCulling;
2021-04-01 16:40:14 +02:00
Array<Gfx::PDescriptorSet> descriptorSets;
PCameraActor source;
2023-11-01 23:12:30 +01:00
Gfx::OPipelineLayout basePassLayout;
2023-11-05 10:36:01 +01:00
// Set 0: viewParameter, provided by renderpass
2023-11-10 19:18:09 +01:00
static constexpr uint32 INDEX_VIEW_PARAMS = 0;
2023-11-10 22:26:47 +01:00
// Set 1: vertex buffers, provided by vertexdata
static constexpr uint32 INDEX_VERTEX_DATA = 1;
// Set 2: instance data, provided by vertexdata
static constexpr uint32 INDEX_SCENE_DATA = 2;
// Set 3: light environment, provided by lightenv
static constexpr uint32 INDEX_LIGHT_ENV = 3;
// Set 4: material data, generated from material
static constexpr uint32 INDEX_MATERIAL = 4;
// Set 5: light culling data
2023-11-05 10:36:01 +01:00
Gfx::ODescriptorLayout lightCullingLayout;
2023-11-10 22:26:47 +01:00
static constexpr uint32 INDEX_LIGHT_CULLING = 5;
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