BlackPearl Engine is a dynamic GI rendering engine to simulate different dynamic GI algorithm,such as light probe based GI,voxel cone tracing GI,image based lighting, sparse voxel octree cone tracing.You can select the algorithm you want to simulate in SandBox.
- select render API, modify the RenderAPI Settings in GenerateProject.bat:
call vendor\bin\premake\premake5.exe vs2022 --RenderAPI=opengl
PAUSE
You can choose RenderAPI from the following three options:
{ "opengl", "OpenGL" },
{ "direct3d", "Direct3D (Windows only)" },
{ "vulkan", "Vulkan" }
- run GenerateProject.bat to set up visual studio project,it is only for Windows now.
- select the GI algorithom in SandBox.cpp(openGL supported algorithm) or SandBoxDX.cpp (directX supported GI algorithm.such as DXR) or SandBoxVK.cpp
SandBox.cpp
class SandBox :public BlackPearl::Application {
public:
SandBox(HINSTANCE hInstance,int nShowCmd, BlackPearl::DynamicRHI::Type rhiType, const std::string &renderer)
:Application(hInstance, nShowCmd, rhiType, renderer){
BlackPearl::Layer* layer = NULL;
const std::string layer_name = renderer+"Layer";
if (renderer == "ShadowMapPointLight") {
layer = DBG_NEW ShadowMapPointLightLayer(layer_name);
}
else if(renderer == "VoxelConeTracing"){
layer = DBG_NEW VoxelConeTracingLayer(layer_name);
}
else if (renderer == "PbrRendering") {
layer = DBG_NEW PbrRenderingLayer(layer_name);
}
else if (renderer == "IBLRendering") {
layer = DBG_NEW IBLRenderingLayer(layer_name);
}
else if (renderer == "IBLProbesRendering") {
layer = DBG_NEW IBLProbesRenderingLayer(layer_name);
}
else if (renderer == "VoxelConeTracingDeferred") {
layer = DBG_NEW VoxelConeTracingDeferredLayer(layer_name);
}
else if (renderer == "VoxelConeTracingSVO") {
layer = DBG_NEW VoxelConeTracingSVOLayer(layer_name);
}
else if (renderer == "RayTracing") {
layer = DBG_NEW RayTracingLayer(layer_name);
}
GetLayerManager()->PushLayer(layer);
}
virtual ~SandBox() = default;
};
BlackPearl::Application* BlackPearl::CreateApplication(HINSTANCE hInstance, int nShowCmd) {
return DBG_NEW SandBox(hInstance, nShowCmd, BlackPearl::DynamicRHI::Type::OpenGL, "IBLProbesRendering");
}
SandBoxDX.cpp
class SandBoxDX :public BlackPearl::Application {
public:
SandBoxDX(HINSTANCE hInstance,int nShowCmd, BlackPearl::DynamicRHI::Type rhiType, const std::string &renderer)
:Application(hInstance, nShowCmd, rhiType, renderer){
BlackPearl::Layer* layer = NULL;
const std::string layer_name = renderer+"Layer";
if (renderer == "D3D12RayTracing") {
layer = DBG_NEW D3D12RayTracingLayer(layer_name);
}
else if (renderer == "D3D12RayTracingCube") {
layer = DBG_NEW D3D12RayTracingCubeLayer(layer_name);
}
else if (renderer == "D3D12RayTracingModelLayer") {
layer = DBG_NEW D3D12RayTracingModelLayer(layer_name);
}
else if (renderer == "D3D12BasicRenderLayer") {
layer = DBG_NEW D3D12BasicRenderLayer(layer_name);
}
GetLayerManager()->PushLayer(layer);
}
virtual ~SandBoxDX() = default;
};
BlackPearl::Application* BlackPearl::CreateApplication(HINSTANCE hInstance, int nShowCmd) {
return DBG_NEW SandBoxDX(hInstance, nShowCmd, BlackPearl::DynamicRHI::Type::D3D12, "D3D12BasicRenderLayer");
}
-
set the SandBox or SandboxDX as the start porject in visual studio
-
play your games! ^-^
- NVIDIA GeForce RTX 2060/PCIe/SSE2
- Windows 10
- OpenGL Version :4.5.0
- IBL
- voxel cone tracing
- light probe GI
- DXR
- Mesh shader
- Batch rendering
- Indirect rendering
- Deffered rendering
- PBR material
- Simple Shadowmap
- Terrain
- ECS
Dynamic Global illumination PPT-DXT00 Master thesis
set reflection probe for each specular object,update specular probe every frame+ update a diffuse probe per frame,probe grid 4x2x4
dynamic enviroment light ---> day and night shifting
reference: ToyRTX https://github.com/Ubpa/ToyRTX
batch rendering only need 9 drawcalls,and maintain 60 fps. improve (objs num/batch num) performance
since the transform matrix needs to be updated every frame ,can only reach 20 fps