/azura_docs

Documentation for Azura Render System

Primary LanguageHTML

title author
Azura Docs
Vasu Mahesh

Azura

A repository containing tools for real-time rendering, general C++, memory allocators, path tracers and more!

Active Platforms on Azura:

Windows Linux
Build Status: Windows Soon™

Active Draw APIs on Azura:

D3D12 Vulkan
Supported Supported

Table of Contents

Dependencies

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.

Render Samples

Procedural Planet

D3D12 Vulkan
Supported Supported

Project features

  • 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

Forward+ Renderer

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.

Frame Debug Views

Albedo Normals Depth

Pipeline Structure

Depth Pre Pass
Compute Pass
Shading Pass

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 lights
    Compute atomic min & max depth
    Per ThreadGroup - Iterate through lights
    Per ThreadGroup - Write active lights to cluster texture
    Barrier
    Barrier
    Barrier
    Per ThreadGroup - Light-Frustum intersection check
  • Shading Pass

    • Read from above Cluster Texture & Shade

NSight Debug Views

Light Texture Cluster Texture
Final Frame

Performance Analysis

FPS vs Number of lights

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.

Percentage Time Spent

This graph shows the percentage time spent by each phase / pass in the pipeline for different amount of lights.

FPS vs Tile Size

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.

FPS vs Compute Threads

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.

References

Building

TLDR

if you want to just do a simple build:

python build.py --project all --target Win64

All Options

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.

Custom CMake Overrides

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
    

Misc

Some pseudo APIs I work on before implementing it on Azura:
Design Gist Link

License

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.