Skip to content

Commit

Permalink
NRD v3.5.0:
Browse files Browse the repository at this point in the history
HIGHLIGHTS:
- REBLUR: important follow up bug & regression fixes
- REBLUR: fixed broken DIRECTIONAL_OCCLUSION denoiser
- REBLUR: significantly reduced memory usage of OCCLUSION & DIRECTIONAL_OCCLUSION denoisers
- REBLUR: improved internal anti-firefly suppressor
- REBLUR: more stable specular tracking
- REBLUR: improved IQ
- REBLUR: temporal stabilization is now less important for IQ (but still needed for antilag)

DETAILS:
- NRD: SH simplifications
- NRD: prepass rotator now scales blur radius by +/- 25%
- NRD: added cutoffs for non-exponential weights to minimize FP precision drifting
- NRD: added optional "NONE" mode for kernel rotation
- NRD: fixed strangely-looking code for texture clearing
- NRD: tweaked hit distance weight to be not stricter than 3%
- NRD: introduced NRD_EPS
- NRD: reduced code entropy
- REBLUR OCCLUSION and DIRECTIONAL_OCCLUSION: switched internal processing to 16-bit UNORM/SNORM instead of 16-bit FLOAT to fix darkening effects when history length is very long
- REBLUR OCCLUSION: significantly reduced memory usage
- REBLUR OCCLUSION: simplified code to be closer to non-occlusion mode
- REBLUR DIRECTIONAL_OCCLUSION: fixed! (was broken after recent changes)
- REBLUR DIRECTIONAL OCCLUSION & SH: fixed internal anti-firefly suppressor
- REBLUR SH: advanced prepass made always on since direction and PDF is available
- REBLUR: rotators now scale blur radius by +/- 25%
- REBLUR: exposed "historyFixFrameNum" and "historyFixStrideBetweenSamples" instead of "historyFixStrength"
- REBLUR: min PDF check moved to encoding phase
- REBLUR: tuned fractions
- REBLUR: fixed "darkening" bias (old regression)
- REBLUR: massaged blur radius calculation
- REBLUR: blur radius boost adjusted by roughness (regression)
- REBLUR: tuned blur radius in spatial passes if number of accumulated frames is low
- REBLUR: massaged curvature angle
- REBLUR: switched to symmetrical kernel
- REBLUR: improved virtual parallax based confidence calculation (less history drops for glossy specular)
- REBLUR: simplified checkerboard resolve & accum speeds interpolation
- REBLUR: relaxed parallax check if history length is short
- REBLUR: fixed potentially numerically unstable direction normalization (regression)
- REBLUR: fixed virtual motion based history accumulation acceleration (regression)
- REBLUR: tweaked plane distance sensitivity after history reset
- REBLUR: switched anti-firefly to 3x3 instead of 5x5
- REBLUR: anti-firefly and fast history clamping improvements
- REBLUR: fixed lost after refactoring scale in "GetSensitivityToDarkness" (regression)
- REBLUR: returned not affecting main history anti-firefly for hitT in temporal stabilization pass (regression)
- REBLUR: fixed ancient code preventing anti-lag from resetting history to 0 (was only 1 frame)
- REBLUR: improved checkerboard resolve for fast history
- REBLUR: matched surface- and virtual- based motion footprint quality calculations
- REBLUR: spatial filtering now follows specular lobe better
- REBLUR: improved behavior in disocclusions
- REBLUR: improved anti-firefly suppressor
- REBLUR: disocclusion check simplification
- REBLUR: used averaged instead of normalized previous normal for backfacing check
- REBLUR: resolved some TODOs
- REBLUR: improved code reuse
- REBLUR: refactoring
- RELAX: unification related renamings
- updated README & UPDATE
- updated MathLib
  • Loading branch information
dzhdanNV committed Aug 30, 2022
1 parent d084005 commit 39b7ae9
Show file tree
Hide file tree
Showing 70 changed files with 1,255 additions and 1,190 deletions.
2 changes: 1 addition & 1 deletion External/MathLib
6 changes: 3 additions & 3 deletions Include/NRD.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.
#include <cstddef>

#define NRD_VERSION_MAJOR 3
#define NRD_VERSION_MINOR 4
#define NRD_VERSION_BUILD 3
#define NRD_VERSION_DATE "19 August 2022"
#define NRD_VERSION_MINOR 5
#define NRD_VERSION_BUILD 0
#define NRD_VERSION_DATE "1 September 2022"

#if defined(_MSC_VER)
#define NRD_CALL __fastcall
Expand Down
6 changes: 3 additions & 3 deletions Include/NRDDescs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.
#pragma once

#define NRD_DESCS_VERSION_MAJOR 3
#define NRD_DESCS_VERSION_MINOR 4
#define NRD_DESCS_VERSION_MINOR 5

static_assert (NRD_VERSION_MAJOR == NRD_DESCS_VERSION_MAJOR && NRD_VERSION_MINOR == NRD_DESCS_VERSION_MINOR, "Please, update all NRD SDK files");

Expand Down Expand Up @@ -165,7 +165,7 @@ namespace nrd
IN_SPEC_HITDIST,

// Noisy bent normal and normalized hit distance (RGBA8+)
// REBLUR: use "REBLUR_FrontEnd_PackDirectionAndNormHitDist" for encoding
// REBLUR: use "REBLUR_FrontEnd_PackDirectionalOcclusion" for encoding
IN_DIFF_DIRECTION_HITDIST,

// Noisy SH data (2x RGBA16f+)
Expand Down Expand Up @@ -222,7 +222,7 @@ namespace nrd
OUT_SPEC_HITDIST,

// Denoised bent normal and normalized hit distance (RGBA8+)
// REBLUR: use "REBLUR_BackEnd_UnpackDirectionAndNormHitDist" for decoding
// REBLUR: use "REBLUR_BackEnd_UnpackDirectionalOcclusion" for decoding
OUT_DIFF_DIRECTION_HITDIST,

// Denoised shadow and optional transcluceny (R8+ or RGBA8+)
Expand Down
47 changes: 25 additions & 22 deletions Include/NRDSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.
#pragma once

#define NRD_SETTINGS_VERSION_MAJOR 3
#define NRD_SETTINGS_VERSION_MINOR 4
#define NRD_SETTINGS_VERSION_MINOR 5

static_assert (NRD_VERSION_MAJOR == NRD_SETTINGS_VERSION_MAJOR && NRD_VERSION_MINOR == NRD_SETTINGS_VERSION_MINOR, "Please, update all NRD SDK files");

Expand Down Expand Up @@ -222,37 +222,40 @@ namespace nrd
// [0; REBLUR_MAX_HISTORY_FRAME_NUM] - maximum number of linearly accumulated frames (= FPS * "time of accumulation")
uint32_t maxAccumulatedFrameNum = 30;

// [0; REBLUR_MAX_HISTORY_FRAME_NUM] - maximum number of linearly accumulated frames in fast history
// [0; REBLUR_MAX_HISTORY_FRAME_NUM] - maximum number of linearly accumulated frames in fast history (less than "maxAccumulatedFrameNum")
uint32_t maxFastAccumulatedFrameNum = 6;

// [0; REBLUR_MAX_HISTORY_FRAME_NUM] - number of reconstructed frames after history reset (less than "maxFastAccumulatedFrameNum")
uint32_t historyFixFrameNum = 3;

// (pixels) - pre-accumulation spatial reuse pass blur radius (0 = disabled, must be used in case of probabilistic sampling)
float diffusePrepassBlurRadius = 30.0f;
float specularPrepassBlurRadius = 50.0f;

// (pixels) - base (worst case) denoising radius (30 is a baseline for 1440p)
// (pixels) - base denoising radius (30 is a baseline for 1440p)
float blurRadius = 30.0f;

// (pixels) - base stride between samples in history reconstruction pass
float historyFixStrideBetweenSamples = 14.0f;

// (normalized %) - defines base blur radius shrinking when number of accumulated frames increases
float minConvergedStateBaseRadiusScale = 0.25f;

// [0; 10] - adaptive radius scale, comes into play if boiling is detected
float maxAdaptiveRadiusScale = 5.0f;

// (normalized %) - base fraction of diffuse or specular lobe angle used to drive normal based rejection
float lobeAngleFraction = 0.1f;
float lobeAngleFraction = 0.13f;

// (normalized %) - base fraction of center roughness used to drive roughness based rejection
float roughnessFraction = 0.05f;
float roughnessFraction = 0.15f;

// [0; 1] - if roughness < this, temporal accumulation becomes responsive and driven by roughness (useful for animated water)
float responsiveAccumulationRoughnessThreshold = 0.0f;

// (normalized %) - stabilizes output, more stabilization improves antilag (clean signals can use lower values)
float stabilizationStrength = 1.0f;

// (normalized %) - aggresiveness of history reconstruction in disoccluded regions (0 - no reconstruction)
float historyFixStrength = 1.0f;

// (normalized %) - represents maximum allowed deviation from local tangent plane
float planeDistanceSensitivity = 0.005f;

Expand Down Expand Up @@ -304,10 +307,13 @@ namespace nrd
uint32_t diffuseMaxAccumulatedFrameNum = 30;
uint32_t specularMaxAccumulatedFrameNum = 30;

// [0; RELAX_MAX_HISTORY_FRAME_NUM] - maximum number of linearly accumulated frames in fast history
// [0; RELAX_MAX_HISTORY_FRAME_NUM] - maximum number of linearly accumulated frames in fast history (less than "maxAccumulatedFrameNum")
uint32_t diffuseMaxFastAccumulatedFrameNum = 6;
uint32_t specularMaxFastAccumulatedFrameNum = 6;

// [0; RELAX_MAX_HISTORY_FRAME_NUM] - number of reconstructed frames after history reset (less than "maxFastAccumulatedFrameNum")
uint32_t historyFixFrameNum = 3;

// A-trous edge stopping Luminance sensitivity
float diffusePhiLuminance = 2.0f;
float specularPhiLuminance = 1.0f;
Expand All @@ -325,14 +331,11 @@ namespace nrd
// (degrees) - slack for the specular lobe angle used in normal based rejection of specular during A-Trous passes
float specularLobeAngleSlack = 0.3f;

// (> 0) - normal edge stopper for cross-bilateral sparse filter
float disocclusionFixEdgeStoppingNormalPower = 8.0f;

// Maximum radius for sparse bilateral filter, expressed in pixels
float disocclusionFixMaxRadius = 14.0f;
// (pixels) - base stride between samples in history reconstruction pass
float historyFixStrideBetweenSamples = 14.0f;

// Cross-bilateral sparse filter will be applied to frames with history length shorter than this value
uint32_t disocclusionFixNumFramesToFix = 3;
// (> 0) - normal edge stopper for history reconstruction pass
float historyFixEdgeStoppingNormalPower = 8.0f;

// [1; 3] - standard deviation scale of color box for clamping main "slow" history to responsive "fast" history
float historyClampingColorBoxSigmaScale = 2.0f;
Expand Down Expand Up @@ -391,13 +394,13 @@ namespace nrd

uint32_t diffuseMaxAccumulatedFrameNum = 30;
uint32_t diffuseMaxFastAccumulatedFrameNum = 6;
uint32_t historyFixFrameNum = 3;

float diffusePhiLuminance = 2.0f;
float diffuseLobeAngleFraction = 0.5f;

float disocclusionFixEdgeStoppingNormalPower = 8.0f;
float disocclusionFixMaxRadius = 14.0f;
uint32_t disocclusionFixNumFramesToFix = 3;
float historyFixEdgeStoppingNormalPower = 8.0f;
float historyFixStrideBetweenSamples = 14.0f;

float historyClampingColorBoxSigmaScale = 2.0f;

Expand Down Expand Up @@ -426,6 +429,7 @@ namespace nrd

uint32_t specularMaxAccumulatedFrameNum = 30;
uint32_t specularMaxFastAccumulatedFrameNum = 6;
uint32_t historyFixFrameNum = 3;

float specularPhiLuminance = 1.0f;
float diffuseLobeAngleFraction = 0.5f;
Expand All @@ -435,9 +439,8 @@ namespace nrd
float specularVarianceBoost = 0.0f;
float specularLobeAngleSlack = 0.3f;

float disocclusionFixEdgeStoppingNormalPower = 8.0f;
float disocclusionFixMaxRadius = 14.0f;
uint32_t disocclusionFixNumFramesToFix = 3;
float historyFixEdgeStoppingNormalPower = 8.0f;
float historyFixStrideBetweenSamples = 14.0f;

float historyClampingColorBoxSigmaScale = 2.0f;

Expand Down
Loading

0 comments on commit 39b7ae9

Please sign in to comment.