• Stars
    star
    160
  • Rank 233,330 (Top 5 %)
  • Language
    C++
  • License
    Other
  • Created over 8 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

HBAO+

HBAOPlus

Welcome to NVIDIA's HBAO+ source code repository. To begin, clone this repository onto your local drive.

See Documentation under \doc.

NVIDIA HBAO+ 4.0.

HBAO+ is a SSAO algorithm designed to achieve high efficiency on DX11 GPUs. The algorithm is based on HBAO [Bavoil and Sainz 2008], with the following differences:

(1.) To minimize cache trashing, HBAO+ does not use any randomization texture. Instead, the algorithm uses an Interleaved Rendering approach, generating the AO in multiple passes with a unique jitter value per pass [Bavoil and Jansen 2013].

(2.) To avoid over-occlusion artifacts, HBAO+ uses a simpler AO approximation than HBAO, similar to "Scalable Ambient Obscurance" [McGuire et al. 2012] [Bukowski et al. 2012].

(3.) To minimize flickering, the HBAO+ is always rendered in full resolution, from full-resolution depths.

(4.) To reduce halo artifacts behind foreground objects, HBAO+ can take as input a second depth layer, using the multi-layer SSAO approach from [Bavoil and Sainz 2009] and [McGuire et al. 2013].

[Bavoil et al. 2008] "Image-Space Horizon-Based Ambient Occlusion" http://www.nvidia.com/object/siggraph-2008-HBAO.html

[Bavoil and Sainz 2009] "Multi-Layer Dual-Resolution Screen-Space Ambient Occlusion" https://dl.acm.org/citation.cfm?id=1598035

[McGuire et al. 2012] "Scalable Ambient Obscurance" http://graphics.cs.williams.edu/papers/SAOHPG12/

[Bukowski et al. 2012] "Scalable High-Quality Motion Blur and Ambient Occlusion" http://graphics.cs.williams.edu/papers/VVSIGGRAPH12/

[Bavoil and Jansen 2013] "Particle Shadows & Cache-Efficient Post-Processing" https://developer.nvidia.com/gdc-2013

[McGuire et al. 2013] "Lighting Deep G-Buffers: Single-Pass, Layered Depth Images with Minimum Separation Applied to Indirect Illumination" http://research.nvidia.com/publication/lighting-deep-g-buffers-single-pass-layered-depth-images-minimum-separation-applied

Package

doc/โ€”HTML documentation

lib/โ€”header file, import libraries and DLLs, for Win32 and Win64.

samples/โ€”source for DX11 & DX12 sample applications demonstrating NVIDIA HBAO+.

Getting Started

INITIALIZE THE LIBRARY:

GFSDK_SSAO_CustomHeap CustomHeap;
CustomHeap.new_ = ::operator new;
CustomHeap.delete_ = ::operator delete;

GFSDK_SSAO_Status status;
GFSDK_SSAO_Context_D3D11* pAOContext;
status = GFSDK_SSAO_CreateContext_D3D11(pD3D11Device, &pAOContext, &CustomHeap);
assert(status == GFSDK_SSAO_OK); // HBAO+ requires feature level 11_0 or above

SET INPUT DEPTHS:

GFSDK_SSAO_InputData_D3D11 Input;
Input.DepthData.DepthTextureType = GFSDK_SSAO_HARDWARE_DEPTHS;
Input.DepthData.pFullResDepthTextureSRV = pDepthStencilTextureSRV;
Input.DepthData.ProjectionMatrix.Data = GFSDK_SSAO_Float4x4(pProjectionMatrix);
Input.DepthData.ProjectionMatrix.Layout = GFSDK_SSAO_ROW_MAJOR_ORDER;
Input.DepthData.MetersToViewSpaceUnits = SceneScale;

SET AO PARAMETERS:

GFSDK_SSAO_Parameters Params;
Params.Radius = 2.f;
Params.Bias = 0.1f;
Params.PowerExponent = 2.f;
Params.Blur.Enable = true;
Params.Blur.Radius = GFSDK_SSAO_BLUR_RADIUS_4;
Params.Blur.Sharpness = 16.f;

SET RENDER TARGET:

GFSDK_SSAO_Output_D3D11 Output;
Output.pRenderTargetView = pOutputColorRTV;
Output.Blend.Mode = GFSDK_SSAO_OVERWRITE_RGB;

RENDER AO:

status = pAOContext->RenderAO(pD3D11Context, Input, Params, Output);
assert(status == GFSDK_SSAO_OK);

Data Flow

Input Requirements The library has entry points for DX11 and DX12. Requires a depth texture to be provided as input, along with associated projection info. Optionally, can also take as input a GBuffer normal texture associated with the input depth texture: Can add normal-mapping details to the AO. Can be used to fix normal reconstruction artifacts with dithered LOD dissolves. But makes the integration more complex. We recommend starting with input normals disabled. Optionally, can also take as input a viewport rectangle associated with the input textures: Defines a sub-area of the input & output full-resolution textures to be sourced and rendered to. The library re-allocates its internal render targets if the Viewport.Width or Viewport.Height changes for a given AO context.

MSAA Support

Requirements The input depth & normal textures are required to have matching dimensions and MSAA sample count. The output render target can have arbitrary dimensions and MSAA sample count. Per-Pixel AO Algorithm If the input textures are MSAA, only sample 0 is used to render the AO. If the output render target is MSAA, a per-pixel AO value is written to all samples. In practice, we have found this strategy to not cause any objectionable artifacts, even when using HBAO+ with TXAA.

More Repositories

1

kaolin

A PyTorch Library for Accelerating 3D Deep Learning Research
Python
4,424
star
2

PhysX

NVIDIA PhysX SDK
C++
2,893
star
3

Falcor

Real-Time Rendering Framework
C++
2,615
star
4

PhysX-3.4

NVIDIA PhysX SDK 3.4
C++
2,307
star
5

kaolin-wisp

NVIDIA Kaolin Wisp is a PyTorch library powered by NVIDIA Kaolin Core to work with neural fields (including NeRFs, NGLOD, instant-ngp and VQAD).
Python
1,451
star
6

rtx-remix

Combined repo for the RTX-Remix runtime
1,354
star
7

DxrTutorials

C++
828
star
8

RTXGI-DDGI

RTX Global Illumination (RTXGI)
C++
685
star
9

GettingStartedWithRTXRayTracing

Getting Started with RTX Ray Tracing
C++
613
star
10

RTX-Path-Tracing

Real-time path tracing library and sample
C++
599
star
11

FleX

C++
579
star
12

nvrhi

C++
525
star
13

RayTracingDenoiser

NVIDIA Ray Tracing Denoiser
HLSL
505
star
14

FaceWorks

A middleware library and sample application for high-quality skin and eye rendering
C++
450
star
15

NVIDIAImageScaling

NVIDIA Image Scaling SDK
C
426
star
16

Streamline

Streamline Integration Framework
C
375
star
17

RTXDI

C++
347
star
18

Blast

A modular destruction SDK designed for performance and flexibility, replacing APEX destruction
C++
331
star
19

dxvk-remix

C++
303
star
20

NvCloth

C
296
star
21

KickstartRT

KickstartRT SDK
C++
185
star
22

Flow

Flow is a sparse grid-based fluid simulation library for real-time applications.
C
168
star
23

donut

C++
164
star
24

bridge-remix

This is the NVIDIA RTX Remix Runtime Bridge repository
C++
146
star
25

SpatiotemporalBlueNoiseSDK

C
127
star
26

Displacement-MicroMap-Toolkit

C++
125
star
27

UnityPhysXPlugin

Experimental Unity package to enable access to NVIDIA PhysX SDK 4 from within Unity.
C#
122
star
28

NRI

C++
90
star
29

RTXMU

C++
89
star
30

donut_examples

C++
72
star
31

ShaderMake

Shader Compilation Tool
C++
72
star
32

NRDSample

C++
69
star
33

GeForceNOW-SDK

This is the home of the SDK for GeForce NOW
C
65
star
34

KickstartRT_demo

Repo for KickstartRT demo application
C++
50
star
35

Opacity-MicroMap-SDK

Opacity Micro-Map SDK Source Repository
C++
36
star
36

MathLib

C++
28
star
37

Displacement-MicroMap-SDK

C++
19
star
38

nas-sample

C++
16
star
39

Streamline_Sample

C++
16
star
40

ComfyUI-RTX-Remix

ComfyUI RTX Remix
Python
14
star
41

Opacity-MicroMap-Samples

Samples repository for the Opacity MicroMap SDK
C++
11
star
42

Displacement-MicroMap-BaryFile

C++
11
star
43

NRIFramework

C
8
star
44

NRISamples

C++
7
star
45

rtxdi-runtime

HLSL
2
star