title | author |
---|---|
Azura Docs |
Vasu Mahesh |
A repository containing tools for real-time rendering, general C++, memory allocators, path tracers and more!
Active Platforms on Azura:
Windows | Linux |
---|---|
Soon™ |
Active Draw APIs on Azura:
D3D12 | Vulkan |
---|---|
Supported | Supported |
Build time dependencies:
Test / Code Sanity dependencies:
Code dependencies:
Most of the dependencies are located at Source/Imports/ and are pulled automatically using git submodule. If you cloned this repository, you can run:
git submodule update --init --recursive
This will download most of the code dependencies.
D3D12 | Vulkan |
---|---|
Supported | Supported |
- Traditional Deferred Pipeline
- 2 G-Buffers
- UV & Terrain Elevation
- Normals
- Reconstruct view space data back in shading phase from buffers
- Multiple Passes - Noise Pass & Sky Pass --> Terrain Pass --> Water Pass
- Blending for Water Pass to be rendered on top of Terrain
Depth Buffer | GBuffer 1 | GBuffer 2 |
---|---|---|
float 32 Bits | float4 Normals | float4 UV + Elevation |
Final Frame |
---|
D3D12 | Vulkan |
---|---|
Supported | Not Supported* |
*Not supported due to missing ComputePool
& ComputePass
implementation for Vulkan. Based on the timeline, support will be added as soon as possible. Issue #34 tracks this pending feature.
Albedo | Normals | Depth |
---|---|---|
Data uploaded only once to GPU:
-
Tile Frustums
We upload only the pre-computed frustums as a StructuredBuffer so we don’t spend time getting each ThreadGroup’s 4 frustums. -
Initial Light Texture
Pass Information:
-
Depth Pre Pass
Regular depth pass no other computation. -
Compute Pass
- Launch 1 ThreadGroup for 1 Tile; For best results threads per group was 256
Animate lightsCompute atomic min & max depthPer ThreadGroup - Iterate through lightsPer ThreadGroup - Write active lights to cluster textureBarrierBarrierBarrierPer ThreadGroup - Light-Frustum intersection check -
Shading Pass
- Read from above Cluster Texture & Shade
Light Texture | Cluster Texture |
---|---|
Final Frame |
---|
From the graph we can see an overall trend where the performance decreases as we increase the number of lights. Note: The lights had a fixed radius of 5.0f.
This graph shows the percentage time spent by each phase / pass in the pipeline for different amount of lights.
Most of the analysis was done with 16x16 tiles, Here is a graph where we keep 512 lights fixed and only vary the tiles on the X and Y axis.
256 and 512 both turned out to be great for computation. But, it is to be noted that they were tried only with 512 lights.
- Original Paper on Forward+ Rendering by Harada et. al
- EA Battlefield 3 - GDC Slides for Forward+ Rendering
if you want to just do a simple build:
python build.py --project all --target Win64
Building Azura may seem complicated but it is essentially 1 python script doing all the magic. Here is a list of options available to the user:
usage: build.py [-h] [--project PROJECT] --target TARGET [--generator GENERATOR] [--configFile CONFIGFILE] [--cmakeConfigFile CMAKECONFIGFILE] [--projectGenerator PROJECTGENERATOR] [--buildPath BUILDPATH] [--projectPath PROJECTPATH] [--verbose] [--debug] [--clean] [--build BUILD] [--projectFiles] [--includeTests] [-v]
optional arguments: -h, --help show this help message and exit
--project PROJECT Project to build
--target TARGET Project to build on
--generator GENERATOR CMake Generator
--configFile CONFIGFILE Config File Override
--cmakeConfigFile CMAKECONFIGFILE CMake Config File Override
--projectGenerator PROJECTGENERATOR CMake Project Files Generator
--buildPath BUILDPATH Build Path
--projectPath PROJECTPATH Projects Path
--verbose Verbose Mode
--debug Debug Commands Mode
--clean Clean the project
--build BUILD Build Release or Debug, defaults to Debug Mode
--projectFiles Flag to tell the build system to generate project files
--includeTests Flag to run tests as well
-v Version
It is highly customizable and uses .ini
files to change configs. For example, the difference between Appveyor and my current local repository is 1 .ini file.
There are two important config (.ini) files that you can provide to Azura build system.
--configFile CONFIGFILE Config File Override
--cmakeConfigFile CMAKECONFIGFILE CMake Config File Override
-
–configFile
Config File is your Environment Config.
[Windows] CMake=Tools/CMake/cmake-3.11.4-win64-x64/bin/ Ninja=Tools/Ninja/ LLVM=Tools/LLVM/x64/LLVM/bin/ VSBuildTools=VisualStudioBuildTools/ MSVCPath=VisualStudioBuildTools/VC/Tools/MSVC/14.14.26428/ Windows10SDKLib=Windows Kits/10/Lib/10.0.17134.0/ Windows10SDKBin=Windows Kits/10/bin/10.0.17134.0/ Windows10SDKInc=Windows Kits/10/Include/10.0.17134.0/
[Linux] ...
[MacOS] ...
If you have custom locations for these above files, you can make a custom ini file and tell Azura to use it. Appveyor basically has its own config located here.
-
–cmakeConfigFile
These are custom CMake Overrides. Here, you can define custom variables that you want. Appveyor for example already has boost, so we just point boost to the correct place and we are done!
[Defines] VULKAN_1_1_77_0_ROOT=C:/AppveyorCache/VulkanSDK/1.1.77.0/ BOOST_ROOT=C:/Libraries/boost_1_67_0 GLFW_3_2_1_32_ROOT=C:/AppveyorCache/GLFW/glfw-3.2.1.bin.WIN32/ GLFW_3_2_1_64_ROOT=C:/AppveyorCache/GLFW/glfw-3.2.1.bin.WIN64/
You can also build private repositories:
FORCE_INCLUDE_SUB_DIRECTORIES=Sandbox;MyCustomPrivateRepo
Some pseudo APIs I work on before implementing it on Azura:
Design Gist Link
Copyright 2018 Vasu Mahesh
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.