Skip to content

Commit

Permalink
v3.8.0:
Browse files Browse the repository at this point in the history
HIGHLIGHTS:
- NRD: introduced optional "NRDEncoding.hlsli"
- NRD: introduced optional per per-pixel disocclusion threshold
- NRD: increased default disocclusion threshold
- NRD: fixed bug leading to rounding materialID 2 to 3
- RELAX / REBLUR: various improvements
- REBLUR: removed settings "minConvergedStateBaseRadiusScale" and "maxAdaptiveRadiusScale"
- REBLUR: specular tracking improvements

DETAILS:
- NRD: introduced optional "NRDEncoding.hlsli"
- NRD: introduced optional per per-pixel disocclusion threshold
- NRD: increased default disocclusion threshold
- NRD: fixed bug leading to rounding materialID 2 to 3
- RELAX / REBLUR: fixed potential SMEM out of bounds access
- RELAX / REBLUR: added support for IN_DISOCCLUSION_THRESHOLD_MIX
- RELAX / REBLUR: improved disocclusion check
- RELAX / REBLUR: improved "back faced" history rejection
- RELAX / REBLUR: fixed previous normal fetching math for footprints touching "background" pixels
- RELAX / REBLUR: refactoring
- RELAX: improved math handling jitter
- RELAX: added view vector- and roughness- based stoppers to A-trous
- RELAX: removed ortho related hack from TA pass
- RELAX: added materialID support to anti-firefly filter
- REBLUR: reduced potential specular smearing
- REBLUR: improved SMB (surface motion based) accumulation speed estimation
- REBLUR: tweaked anti-firefly suppressor settings
- REBLUR: tweaked roughness weight for specular VMB (virtual motion based) tracking
- REBLUR: fixed parallax-based specular confidence for VMB (was too aggressive at high FPS)
- REBLUR: removed settings "minConvergedStateBaseRadiusScale" and "maxAdaptiveRadiusScale"
- REBLUR: improved checkerboard resolve if amount of SMB is high
- REBLUR: fixed potential over-sharpening in disoccluded regions (ancient regression)
- REBLUR: increased aggressiveness of curvature correction
- REBLUR: improved hitT for tracking in TS pass
- REBLUR: fixed potential out of screen roughness check in TA pass
- REBLUR: resolved TODOs
- REBLUR: improved curvature estimation if parallax is high
- REBLUR: tuned settings of virtual parallax difference based confidence to minimize potential ghosting
- REBLUR: fixed SMB data influence on VMB in TS pass
- REBLUR: fixed bug not allowing a lower value to be clamped to a bigger value from fast history
- SPECULAR_REFLECTION_MV: updated curvature calculation math
- improved docs
  • Loading branch information
dzhdanNV committed Oct 28, 2022
1 parent 5405b46 commit d08a0e1
Show file tree
Hide file tree
Showing 81 changed files with 1,370 additions and 1,719 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Makefile
*.dxbc.h
*.dxil.h
*.spirv.h
NRDEncoding.hlsli

# ninja
.ninja_deps
Expand Down
1 change: 1 addition & 0 deletions 3-Prepare NRD SDK.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ copy "..\_Build\Debug\NRD.pdb" "Lib\Debug"
copy "..\_Build\Release\NRD.dll" "Lib\Release"
copy "..\_Build\Release\NRD.lib" "Lib\Release"
copy "..\%NRD_DIR%\Shaders\Include\NRD.hlsli" "Shaders\Include"
copy "..\%NRD_DIR%\Shaders\Include\NRDEncoding.hlsli" "Shaders\Include"
copy "..\%NRD_DIR%\LICENSE.txt" "."
copy "..\%NRD_DIR%\README.md" "."

Expand Down
1 change: 1 addition & 0 deletions 3-Prepare NRD SDK.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cp -r ../$NRD_DIR/Include/ "Include"
cp -H ../_Build/Debug/libNRD.so "Lib/Debug"
cp -H ../_Build/Release/libNRD.so "Lib/Release"
cp ../$NRD_DIR/Shaders/Include/NRD.hlsli "Shaders/Include"
cp ../$NRD_DIR/Shaders/Include/NRDEncoding.hlsli "Shaders/Include"
cp ../$NRD_DIR/LICENSE.txt "."
cp ../$NRD_DIR/README.md "."

Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ option(NRD_CROSSCOMPILE_AARCH64 "Cross compilation for aarch64" OFF)
option(NRD_CROSSCOMPILE_X86_64 "Cross compilation for x86_64" OFF)
option(NRD_INTERPROCEDURAL_OPTIMIZATION "Interprocedural optimization" OFF)

file(WRITE Shaders/Include/NRDEncoding.hlsli
"// This file is auto-generated during project deployment. Do not modify!\n"
"#define NRD_NORMAL_ENCODING ${NRD_NORMAL_ENCODING}\n"
"#define NRD_ROUGHNESS_ENCODING ${NRD_ROUGHNESS_ENCODING}\n"
)

file(READ "${CMAKE_CURRENT_SOURCE_DIR}/Include/NRD.h" ver_h)
string(REGEX MATCH "NRD_VERSION_MAJOR ([0-9]*)" _ ${ver_h})
set(ver_major ${CMAKE_MATCH_1})
Expand Down
2 changes: 1 addition & 1 deletion External/MathLib
4 changes: 2 additions & 2 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 7
#define NRD_VERSION_MINOR 8
#define NRD_VERSION_BUILD 0
#define NRD_VERSION_DATE "19 September 2022"
#define NRD_VERSION_DATE "27 October 2022"

#if defined(_MSC_VER)
#define NRD_CALL __fastcall
Expand Down
9 changes: 7 additions & 2 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 7
#define NRD_DESCS_VERSION_MINOR 8

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 @@ -180,6 +180,11 @@ namespace nrd
IN_DIFF_CONFIDENCE,
IN_SPEC_CONFIDENCE,

// (Optional) User-provided disocclusion threshold selector in range 0-1 (R8+)
// Disocclusion threshold is mixed between "disocclusionThreshold" and "disocclusionThresholdAlternate"
// Used only if "CommonSettings::isDisocclusionThresholdMixAvailable = true"
IN_DISOCCLUSION_THRESHOLD_MIX,

// Noisy shadow data and optional translucency (RG16f+ and RGBA8+ for optional translucency)
// SIGMA: use "SIGMA_FrontEnd_PackShadow" for encoding
IN_SHADOWDATA,
Expand Down Expand Up @@ -330,7 +335,7 @@ namespace nrd
RGBA8_UNORM,
RGBA8_SNORM,

// Moderate IQ on curved (not bumpy) surfaces, but offers optional materialID support
// Moderate IQ on curved (not bumpy) surfaces, but offers optional materialID support (normals are oct-packed)
R10_G10_B10_A2_UNORM,

// Best IQ on curved (not bumpy) surfaces
Expand Down
32 changes: 17 additions & 15 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 7
#define NRD_SETTINGS_VERSION_MINOR 8

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 @@ -109,8 +109,11 @@ namespace nrd
// (units) > 0 - use TLAS or tracing range (max value = NRD_FP16_MAX / NRD_FP16_VIEWZ_SCALE - 1 = 524031)
float denoisingRange = 500000.0f;

// (normalized %) - if relative distance difference is greater than threshold, history gets reset (0.25-1.5% works well)
float disocclusionThreshold = 0.005f;
// (normalized %) - if relative distance difference is greater than threshold, history gets reset (0.5-2.5% works well)
float disocclusionThreshold = 0.01f;

// (normalized %) - alternative disocclusion threshold, which is mixed to based on IN_DISOCCLUSION_THRESHOLD_MIX
float disocclusionThresholdAlternate = 0.01f;

// [0; 1] - enables "noisy input / denoised output" comparison
float splitScreen = 0.0f;
Expand All @@ -133,6 +136,9 @@ namespace nrd

// If "true" IN_DIFF_CONFIDENCE and IN_SPEC_CONFIDENCE are provided
bool isHistoryConfidenceInputsAvailable = false;

// If "true" IN_DISOCCLUSION_THRESHOLD_MIX is provided
bool isDisocclusionThresholdMixAvailable = false;
};

// REBLUR
Expand Down Expand Up @@ -218,17 +224,11 @@ namespace nrd
float specularPrepassBlurRadius = 50.0f;

// (pixels) - base denoising radius (30 is a baseline for 1440p)
float blurRadius = 30.0f;
float blurRadius = 15.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.13f;

Expand Down Expand Up @@ -311,7 +311,7 @@ namespace nrd
float specularVarianceBoost = 0.0f;

// (degrees) - slack for the specular lobe angle used in normal based rejection of specular during A-Trous passes
float specularLobeAngleSlack = 0.3f;
float specularLobeAngleSlack = 0.15f;

// (pixels) - base stride between samples in history reconstruction pass
float historyFixStrideBetweenSamples = 14.0f;
Expand Down Expand Up @@ -340,10 +340,12 @@ namespace nrd
float confidenceDrivenLuminanceEdgeStoppingRelaxation = 0.0f;
float confidenceDrivenNormalEdgeStoppingRelaxation = 0.0f;

// How much we relax roughness based rejection in areas where specular reprojection is low
// How much we relax roughness based rejection for spatial filter in areas where specular reprojection is low
float luminanceEdgeStoppingRelaxation = 0.5f;
float normalEdgeStoppingRelaxation = 0.3f;
float roughnessEdgeStoppingRelaxation = 0.3f;

// How much we relax rejection for spatial filter based on roughness and view vector
float roughnessEdgeStoppingRelaxation = 1.0f;

// If not OFF and used for DIFFUSE_SPECULAR, defines diffuse orientation, specular orientation is the opposite
CheckerboardMode checkerboardMode = CheckerboardMode::OFF;
Expand Down Expand Up @@ -419,7 +421,7 @@ namespace nrd
float roughnessFraction = 0.15f;

float specularVarianceBoost = 0.0f;
float specularLobeAngleSlack = 0.3f;
float specularLobeAngleSlack = 0.15f;

float historyFixEdgeStoppingNormalPower = 8.0f;
float historyFixStrideBetweenSamples = 14.0f;
Expand All @@ -437,7 +439,7 @@ namespace nrd

float luminanceEdgeStoppingRelaxation = 0.5f;
float normalEdgeStoppingRelaxation = 0.3f;
float roughnessEdgeStoppingRelaxation = 0.3f;
float roughnessEdgeStoppingRelaxation = 1.0f;

CheckerboardMode checkerboardMode = CheckerboardMode::OFF;
HitDistanceReconstructionMode hitDistanceReconstructionMode = HitDistanceReconstructionMode::OFF;
Expand Down
Loading

0 comments on commit d08a0e1

Please sign in to comment.