Venus Engine
Trailer Overview
About Venus Engine
Venus Engine is a lightweight game engine. It designed to take full advantage of DirectX 12 and DirectX Raytracing framework (DXR). The engine is intended to be used as graphics engine of my thesis and personal project by referencing several engines, including MiniEngine and Diligent Engine.
Artifacts
-
Thesis: Real-time Ray-traced Caustics Effects
Caustics effects of static glassware
Caustics effects of water
-
Project: Complex Miner
Using screen space lighting
Goals
-
Learning and mastering the D3D12 modern api and HLSL 6.0+.
-
Implementing the real-time raytracing method by using DirectX Raytracing framework (DXR).
-
Integrating multi-threading rendering.
Features
-
DirectX 12 based renderer
-
DirectX Raytracing framework
-
CPU driven multi-threading job system
-
Deferred rendering
-
BRDF with PBR material
Resources Management
Buffers and Textures Resources
In traditional Direct3D application, resources were created with specific types, such as ID3D11Buffer and ID3D11Texture2D. The designed purposes behind this were intent to allow user to manage resources creation with different API functions. In D3D12, this design pattern was removed and replaced with only ID3D12Resource.
Venus Engine embedded different resources in C++ classes. Below diagrams illustrate the resource framework in Venus.
Dynamic Resource Allocation
To minimize overhead costs of resource creation, Venus Engine implemented the dynamic resource allocation using object pool pattern. Below source codes are dynamic resource structures and methods.
ResourceAllocator.hpp
ResourceAllocator.cpp
DirectX Raytracing Framework
HLSL 6.0
In DXR framework, the raytracing shader requires the compiler with HLSL 6.0. Venus Engine use dxcompiler.lib to compile raytracing shader in runtime. Here's the compilation and validation code of DXR shader.
Shader.cpp
DXR Class
DXR framework is designed to allow implementations to process rays independently. This includes the raytracing shader group, acceleration structure and state object. For more information, please refer to DXR Functional Spec.
In Venus Engine, I implemented the following classes:
-
RaytracingStateObject
-
ShaderTable
-
AccelerationStructure
The code below is the raytracing function called by renderer.
Shader.cpp