2
3
4
5
9#include "Render/Renderer/Renderer.h"
19 std::array<SpicesShader::DirectionalLight, SpicesShader::DIRECTIONALLIGHT_BUFFER_MAXNUM>
lights;
24 std::array<SpicesShader::PointLight, SpicesShader::POINTLIGHT_BUFFER_MAXNUM>
lights;
35
36
37
43
44
45
46
47
48
49
50
52 const std::string& rendererName ,
60
61
65
66
67
68
72
73
74
80
81
82
86
87
88
92
93
97
98
99
100
101
102
104 std::shared_ptr<
Material> material ,
105 VkPipelineLayout& layout ,
112
113
114
115
116
119 std::shared_ptr<std::vector<uint32_t>> view,
124
125
126
127
128
129
132 std::shared_ptr<std::vector<uint32_t>> view,
138
139
140
141
142
143
151
152
153
159
160
161
165
166
167
168 void SetHitGroupsCache(std::shared_ptr<std::unordered_map<std::string, uint32_t>> cache) { m_HitGroupsCache = cache; }
173
174
178
179
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
static FrameInfo & Get()
Get FrameInfo.
RendererType m_RendererType
The renderer type of current world.
FrameInfo Class. This class defines the FrameInfo data.
Material Class. This class contains a branch of parameter and shader, also descriptor.
MeshComponent Class. This class defines the specific behaves of MeshComponent.
virtual void CreateDescriptorSet() override
The interface is inherited from Renderer. Create specific descriptor set for sub pass.
static std::shared_ptr< VulkanRayTracing > m_VulkanRayTracing
In Used VulkanRayTracing.
void CreateTopLevelAS(FrameInfo &frameInfo, std::shared_ptr< std::vector< uint32_t > > view, std::shared_ptr< VulkanRayTracing > rayTracingInstance, bool update=false)
Create TopLevelAS.
static VkAccelerationStructureKHR GetAccelerationStructure()
Get RayTracing AccelerationStructure.
void SetHitGroupsCache(std::shared_ptr< std::unordered_map< std::string, uint32_t > > cache)
Set HitGroupsCache.
virtual void CreatePipeline(std::shared_ptr< Material > material, VkPipelineLayout &layout, std::shared_ptr< RendererSubPass > subPass) override
The interface is inherited from Renderer. Create Material Specific Pipeline.
virtual void Render(TimeStep &ts, FrameInfo &frameInfo) override
The interface is inherited from Renderer.
RayTracingRenderer(const std::string &rendererName, VulkanState &vulkanState, const std::shared_ptr< VulkanDescriptorPool > &descriptorPool, const std::shared_ptr< VulkanDevice > &device, const std::shared_ptr< RendererResourcePool > &rendererResourcePool)
Constructor Function. Init member variables.
virtual void OnMeshAddedWorld() override
virtual ~RayTracingRenderer() override
Destructor Function.
std::shared_ptr< std::unordered_map< std::string, uint32_t > > GetHitGroupsCache()
Get HitGroupsCache.
std::shared_ptr< std::unordered_map< std::string, uint32_t > > m_HitGroupsCache
Hit groups cached data.
void CreateRTShaderBindingTable(std::shared_ptr< VulkanRayTracing > rayTracingInstance)
Create Shader Binding Table.
virtual void CreateRendererPass() override
The interface is inherited from Renderer. Create specific render pass.
void CreateBottomLevelAS(FrameInfo &frameInfo, std::shared_ptr< std::vector< uint32_t > > view, std::shared_ptr< VulkanRayTracing > rayTracingInstance)
Create BottomLevelAS with all MeshComponents.
void UpdateTopLevelAS(FrameInfo &frameInfo, std::shared_ptr< VulkanRayTracing > rayTracingInstance, bool update=true)
Update TopLevelAS.
RayTracingRenderer Class. This class defines the ray tracing behaves.
RendererResourcePool Class. This class is a pool of all framebuffer's attachment.
This Class Combines some data relative to sub pass. Usually as a member variable of RendererPass.
virtual void EndRenderPass() override
End this Renderer's RenderPass.
void TraceRays() const
Call vkCmdTraceRaysKHR here.
virtual void BeginRenderPass() override
Begin this Renderer's RenderPass.
This class helps to bind pipeline and bind buffer. Specific for RayTracing Renderer....
RendererPassBuilder & EndSubPass()
End recording a sub pass.
void Build() const
Build the RendererPass.
RendererPassBuilder & AddSubPass(const std::string &subPassName, Querier::StatisticsFlags flags=Querier::ALL)
Add a new SubPass to Renderer Pass.
virtual void OnMeshAddedWorld()
Renderer(const std::string &rendererName, VulkanState &vulkanState, const std::shared_ptr< VulkanDescriptorPool > &DescriptorPool, const std::shared_ptr< VulkanDevice > &device, const std::shared_ptr< RendererResourcePool > &rendererResourcePool, bool isLoadDefaultMaterial=true)
Constructor Function. Init member variables.
void GetDirectionalLight(FrameInfo &frameInfo, std::array< SpicesShader::DirectionalLight, SpicesShader::DIRECTIONALLIGHT_BUFFER_MAXNUM > &dLightBuffer)
Get DirectionalLightComponent's render data in World.
void GetPointLight(FrameInfo &frameInfo, std::array< SpicesShader::PointLight, SpicesShader::POINTLIGHT_BUFFER_MAXNUM > &pLightBuffer)
Get PointLightComponent's render data in World.
Renderer Class. This class defines the basic behaves of renderer. When we add an new Renderer,...
SkyBoxComponent Class. This class defines the specific behaves of SkyBoxComponent.
This Class handles our engine time step during frames. Global Unique.
VulkanDescriptorPool Class. This class is the wrapper of VkDescriptorPool.
VulkanInstance Class. This class defines the VulkanDevice behave. This class is just a wrapper of vkd...
Wrapper of Scene RayTracing (KHR/VK) Features and Data.
World Class. This class defines the basic behaves of World. When we create an new world,...
std::array< SpicesShader::DirectionalLight, SpicesShader::DIRECTIONALLIGHT_BUFFER_MAXNUM > lights
std::array< SpicesShader::PointLight, SpicesShader::POINTLIGHT_BUFFER_MAXNUM > lights
This struct contains all Vulkan object in used global.