Skip to content

Commit

Permalink
v4.9.0:
Browse files Browse the repository at this point in the history
HIGHLIGHTS:
- NRD: exposed "CommonSettings::strandMaterialID" and "CommonSettings::strandThickness" to improve denoising on hair and grass
- REBLUR: improved IQ without stabilization pass
- REBLUR: improved behavior in disocclusions and in case of a short history
- REBLUR: improved specular tracking
- REBLUR: exposed new settings "hitDistanceStabilizationStrength" and "fireflySuppressorMinRelativeScale"
- improvements and bug fixes

BREAKING CHANGES:
- REBLUR: changed usage of "maxBlurRadius" and its default value, old values should be multiplied by "2"

DETAILS:
- NRD: improved comments in main headers, added missing info
- NRD: added optional "NRD_FrontEnd_TrimHitDistance" to "NRD.hlsli"
- NRD: added "NRD_GetNormalizedStrandThickness" helper to "NRD.hlsli"
- NRD: exposed "CommonSettings::strandMaterialID" and "CommonSettings::strandThickness"
- NRD: exposed NRD_USE_HISTORY_CONFIDENCE, NRD_USE_DISOCCLUSION_THRESHOLD_MIX and NRD_USE_BASECOLOR_METALNESS macro switches allowing to disable almost dead and rarely used code
- SIGMA: fixed very rare 2 pixel wide bleeding (introduced by Temporal Stabilization pass under special conditions)
- RELAX: fixed disocclusion threshold scaling
- RELAX: added missing "rect origin" offsets to IN_DIFF_CONFIDENCE, IN_SPEC_CONFIDENCE and IN_DISOCCLUSION_THRESHOLD_MIX inputs
- REBLUR / RELAX: slope scale should not make disocclusion threshold > 1
- REBLUR / RELAX: hooked up "strandMaterialID" and updated disocclusion threshold logic
- REBLUR: exposed "ReblurSettings::hitDistanceStabilizationStrength" allowing to control AO/SO responsiveness in the temporal stabilization pass and to reach parity with OCCLUSION denoisers if set to "0"
- REBLUR: exposed "ReblurSettings::fireflySuppressorMinRelativeScale" (was previously a macro)
- REBLUR: relaxed temporal stabilization pass on "strandMaterialID"
- REBLUR: improved specular tracking by optimizing "smb" based accumulation
- REBLUR: improved firefly suppressor (making REBLUR more usable without stabilization)
- REBLUR: improved validation (highlights hitT outside of [0; 1] range)
- REBLUR: removed error estimation used for blur radius correction (barely affected image since ~v4 release)
- REBLUR: reduced ghosting on variadic roughness (more roughness details)
- REBLUR: implemented linear progression of blur radius (much cleaner disocclusions)
- REBLUR_OCCLUSION: disabled firefly suppression for hit distances (could lead to bias in disocclusions)
- REBLUR_OCCLUSION: anti-firefly is disabled in DIRECTIONAL_OCCLUSION too
- REBLUR_OCCLUSION: minor fast history improvements
- updated MathLib
- updated docs
- polishing
  • Loading branch information
dzhdanNV committed Aug 1, 2024
1 parent 7693e41 commit 1762023
Show file tree
Hide file tree
Showing 304 changed files with 1,229 additions and 1,259 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ if (WIN32)
endif ()

# External/MathLib
file (READ "External/MathLib/MathLib.h" ver_h)
file (READ "External/MathLib/ml.h" ver_h)
string (REGEX MATCH "ML_VERSION_MAJOR ([0-9]*)" _ ${ver_h})
set (ML_VERSION_MAJOR ${CMAKE_MATCH_1})
string (REGEX MATCH "ML_VERSION_MINOR ([0-9]*)" _ ${ver_h})
Expand Down
2 changes: 1 addition & 1 deletion External/MathLib
Submodule MathLib updated 25 files
+236 −0 .clang-format
+1 −1 External/sse2neon
+77 −0 Guts/bool1.h
+258 −0 Guts/conversion.h
+1,636 −0 Guts/emulation.h
+176 −0 Guts/f16.h
+1,897 −0 Guts/f32.h
+1,900 −0 Guts/f64.h
+290 −0 Guts/i32.h
+1,624 −0 Guts/math.h
+233 −0 Guts/other.h
+278 −0 Guts/packing.h
+138 −0 Guts/sorting.h
+818 −0 Guts/swizzle.h
+561 −0 Guts/tests.h
+278 −0 Guts/u32.h
+0 −2,845 IntrinEmu.h
+0 −3,332 MathLib.h
+0 −2,023 MathLib_d.h
+0 −2,266 MathLib_f.h
+0 −622 Packed.h
+22 −10 README.md
+0 −3,021 STL.hlsli
+1,139 −0 ml.h
+3,069 −0 ml.hlsli
2 changes: 1 addition & 1 deletion External/ShaderMake
Submodule ShaderMake updated 2 files
+3 −1 README.md
+32 −5 src/ShaderMake.cpp
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 4
#define NRD_VERSION_MINOR 8
#define NRD_VERSION_BUILD 2
#define NRD_VERSION_DATE "14 June 2024"
#define NRD_VERSION_MINOR 9
#define NRD_VERSION_BUILD 0
#define NRD_VERSION_DATE "1 August 2024"

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

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 @@ -50,19 +50,19 @@ namespace nrd
IN_VIEWZ,

// (Optional) User-provided history confidence in range 0-1, i.e. antilag (R8+)
// Used only if "CommonSettings::isHistoryConfidenceAvailable = true"
// Used only if "CommonSettings::isHistoryConfidenceAvailable = true" and "NRD_USE_HISTORY_CONFIDENCE = 1"
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"
// Used only if "CommonSettings::isDisocclusionThresholdMixAvailable = true" and "NRD_USE_DISOCCLUSION_THRESHOLD_MIX = 1"
IN_DISOCCLUSION_THRESHOLD_MIX,

// (Optional) Base color (can be decoupled to diffuse and specular albedo based on metalness) and metalness (RGBA8+)
// Used only if "CommonSettings::isBaseColorMetalnessAvailable = true". Currently used only by REBLUR (if temporal
// stabilization pass is available and "stabilizationStrength != 0") to patch MV if specular (virtual) motion prevails
// on diffuse (surface) motion
// Used only if "CommonSettings::isBaseColorMetalnessAvailable = true" and "NRD_USE_BASECOLOR_METALNESS = 1".
// Currently used only by REBLUR (if Temporal Stabilization pass is available and "stabilizationStrength != 0")
// to patch MV if specular (virtual) motion prevails on diffuse (surface) motion
IN_BASECOLOR_METALNESS,

//=============================================================================================================================
Expand Down Expand Up @@ -160,94 +160,82 @@ namespace nrd
enum class Denoiser : uint32_t
{
/*
IMPORTANT: IN_MV, IN_NORMAL_ROUGHNESS, IN_VIEWZ are used by any denoiser
These denoisers DON'T use:
SIGMA_SHADOW & SIGMA_SHADOW_TRANSLUCENCY - IN_MV, if "stabilizationStrength = 0"
REFERENCE - IN_MV, IN_NORMAL_ROUGHNESS, IN_VIEWZ
IMPORTANT:
- IN_MV, IN_NORMAL_ROUGHNESS, IN_VIEWZ are used by any denoiser, but these denoisers DON'T use:
- SIGMA_SHADOW & SIGMA_SHADOW_TRANSLUCENCY - IN_MV, if "stabilizationStrength = 0"
- REFERENCE - IN_MV, IN_NORMAL_ROUGHNESS, IN_VIEWZ
- Optional inputs are in ()
*/

// =============================================================================================================================
// REBLUR
// =============================================================================================================================

// INPUTS - IN_DIFF_RADIANCE_HITDIST,
// OPTIONAL INPUTS - IN_DIFF_CONFIDENCE
// INPUTS - IN_DIFF_RADIANCE_HITDIST (IN_DIFF_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_DIFF_RADIANCE_HITDIST
REBLUR_DIFFUSE,

// INPUTS - IN_DIFF_HITDIST,
// INPUTS - IN_DIFF_HITDIST (IN_DIFF_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_DIFF_HITDIST
REBLUR_DIFFUSE_OCCLUSION,

// INPUTS - IN_DIFF_SH0, IN_DIFF_SH1
// OPTIONAL INPUTS - IN_DIFF_CONFIDENCE
// INPUTS - IN_DIFF_SH0, IN_DIFF_SH1 (IN_DIFF_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_DIFF_SH0, OUT_DIFF_SH1
REBLUR_DIFFUSE_SH,

// INPUTS - IN_SPEC_RADIANCE_HITDIST,
// OPTIONAL INPUTS - IN_SPEC_DIRECTION_PDF, IN_SPEC_CONFIDENCE
// INPUTS - IN_SPEC_RADIANCE_HITDIST (IN_SPEC_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX, IN_BASECOLOR_METALNESS)
// OUTPUTS - OUT_SPEC_RADIANCE_HITDIST
REBLUR_SPECULAR,

// INPUTS - IN_SPEC_HITDIST,
// INPUTS - IN_SPEC_HITDIST (IN_SPEC_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_SPEC_HITDIST
REBLUR_SPECULAR_OCCLUSION,

// INPUTS - IN_SPEC_SH0, IN_SPEC_SH1
// OPTIONAL INPUTS - IN_SPEC_CONFIDENCE
// INPUTS - IN_SPEC_SH0, IN_SPEC_SH1 (IN_SPEC_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX, IN_BASECOLOR_METALNESS)
// OUTPUTS - OUT_SPEC_SH0, OUT_SPEC_SH1
REBLUR_SPECULAR_SH,

// INPUTS - IN_DIFF_RADIANCE_HITDIST, IN_SPEC_RADIANCE_HITDIST,
// OPTIONAL INPUTS - IN_DIFF_CONFIDENCE, IN_SPEC_CONFIDENCE
// INPUTS - IN_DIFF_RADIANCE_HITDIST, IN_SPEC_RADIANCE_HITDIST (IN_DIFF_CONFIDENCE, IN_SPEC_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX, IN_BASECOLOR_METALNESS)
// OUTPUTS - OUT_DIFF_RADIANCE_HITDIST, OUT_SPEC_RADIANCE_HITDIST
REBLUR_DIFFUSE_SPECULAR,

// INPUTS - IN_DIFF_HITDIST, IN_SPEC_HITDIST,
// INPUTS - IN_DIFF_HITDIST, IN_SPEC_HITDIST (IN_DIFF_CONFIDENCE, IN_SPEC_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_DIFF_HITDIST, OUT_SPEC_HITDIST
REBLUR_DIFFUSE_SPECULAR_OCCLUSION,

// INPUTS - IN_DIFF_SH0, IN_DIFF_SH1, IN_SPEC_SH0, IN_SPEC_SH1
// OPTIONAL INPUTS - IN_DIFF_CONFIDENCE, IN_SPEC_CONFIDENCE
// INPUTS - IN_DIFF_SH0, IN_DIFF_SH1, IN_SPEC_SH0, IN_SPEC_SH1 (IN_DIFF_CONFIDENCE, IN_SPEC_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX, IN_BASECOLOR_METALNESS)
// OUTPUTS - OUT_DIFF_SH0, OUT_DIFF_SH1, OUT_SPEC_SH0, OUT_SPEC_SH1
REBLUR_DIFFUSE_SPECULAR_SH,

// INPUTS - IN_DIFF_DIRECTION_HITDIST,
// OPTIONAL INPUTS - IN_DIFF_CONFIDENCE
// INPUTS - IN_DIFF_DIRECTION_HITDIST (IN_DIFF_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_DIFF_DIRECTION_HITDIST
REBLUR_DIFFUSE_DIRECTIONAL_OCCLUSION,

// =============================================================================================================================
// RELAX
// =============================================================================================================================

// INPUTS - IN_DIFF_RADIANCE_HITDIST
// OPTIONAL INPUTS - IN_DIFF_CONFIDENCE
// INPUTS - IN_DIFF_RADIANCE_HITDIST (IN_DIFF_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_DIFF_RADIANCE_HITDIST
RELAX_DIFFUSE,

// INPUTS - IN_DIFF_SH0, IN_DIFF_SH1
// OPTIONAL INPUTS - IN_DIFF_CONFIDENCE
// INPUTS - IN_DIFF_SH0, IN_DIFF_SH1 (IN_DIFF_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_DIFF_SH0, OUT_DIFF_SH1
RELAX_DIFFUSE_SH,

// INPUTS - IN_SPEC_RADIANCE_HITDIST
// OPTIONAL INPUTS - IN_SPEC_CONFIDENCE
// INPUTS - IN_SPEC_RADIANCE_HITDIST (IN_SPEC_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_SPEC_RADIANCE_HITDIST
RELAX_SPECULAR,

// INPUTS - IN_SPEC_SH0, IN_SPEC_SH1
// OPTIONAL INPUTS - IN_SPEC_CONFIDENCE
// INPUTS - IN_SPEC_SH0, IN_SPEC_SH1 (IN_SPEC_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_SPEC_SH0, OUT_SPEC_SH1
RELAX_SPECULAR_SH,

// INPUTS - IN_DIFF_RADIANCE_HITDIST, IN_SPEC_RADIANCE_HITDIST
// OPTIONAL INPUTS - IN_DIFF_CONFIDENCE, IN_SPEC_CONFIDENCE
// INPUTS - IN_DIFF_RADIANCE_HITDIST, IN_SPEC_RADIANCE_HITDIST (IN_DIFF_CONFIDENCE, IN_SPEC_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_DIFF_RADIANCE_HITDIST, OUT_SPEC_RADIANCE_HITDIST
RELAX_DIFFUSE_SPECULAR,

// INPUTS - IN_DIFF_SH0, IN_DIFF_SH1, IN_SPEC_SH0, IN_SPEC_SH1
// OPTIONAL INPUTS - IN_DIFF_CONFIDENCE, IN_SPEC_CONFIDENCE
// INPUTS - IN_DIFF_SH0, IN_DIFF_SH1, IN_SPEC_SH0, IN_SPEC_SH1 (IN_DIFF_CONFIDENCE, IN_SPEC_CONFIDENCE, IN_DISOCCLUSION_THRESHOLD_MIX)
// OUTPUTS - OUT_DIFF_SH0, OUT_DIFF_SH1, OUT_SPEC_SH0, OUT_SPEC_SH1
RELAX_DIFFUSE_SPECULAR_SH,

Expand Down Expand Up @@ -360,7 +348,7 @@ namespace nrd
RGBA8_UNORM,
RGBA8_SNORM,

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

// Best IQ on curved (not bumpy) surfaces
Expand Down
49 changes: 34 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 4
#define NRD_SETTINGS_VERSION_MINOR 8
#define NRD_SETTINGS_VERSION_MINOR 9

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 @@ -68,6 +68,8 @@ namespace nrd
MAX_NUM
};

// IMPORTANT: if "unit" is not "meter", all default values must be converted from "meters" to "units"!

struct CommonSettings
{
// Matrix requirements:
Expand Down Expand Up @@ -96,7 +98,7 @@ namespace nrd
0.0f, 0.0f, 0.0f, 1.0f
};

// used as "IN_MV * motionVectorScale" (use .z = 0 for 2D screen-space motion)
// Used as "IN_MV * motionVectorScale" (use .z = 0 for 2D screen-space motion)
float motionVectorScale[3] = {1.0f, 1.0f, 0.0f};

// [-0.5; 0.5] - sampleUv = pixelUv + cameraJitter
Expand All @@ -115,15 +117,24 @@ namespace nrd
// (ms) - user provided if > 0, otherwise - tracked internally
float timeDeltaBetweenFrames = 0.0f;

// (units) > 0 - use TLAS or tracing range
// (units > 0) - use TLAS or tracing range
float denoisingRange = 500000.0f;

// (normalized %) - if relative distance difference is greater than threshold, history gets reset (0.5-2.5% works well)
// [0.01; 0.02] - if relative distance difference is greater than the threshold (slope scaled), the accumulation process gets restarted
float disocclusionThreshold = 0.01f;

// (normalized %) - alternative disocclusion threshold, which is mixed to based on IN_DISOCCLUSION_THRESHOLD_MIX
// [0.02; 0.2] - an alternative disocclusion threshold, which is mixed to based on:
// - "strandThickness", if there is "strandMaterialID" match
// - IN_DISOCCLUSION_THRESHOLD_MIX texture, if "isDisocclusionThresholdMixAvailable = true" (has higher priority and ignores "strandMaterialID")
float disocclusionThresholdAlternate = 0.05f;

// [0; 1] - Enables "under-the-hood" tweaks for hair (and grass) denoising (requires "NormalEncoding::R10_G10_B10_A2_UNORM")
// Must respect material ID encoding
float strandMaterialID = 999.0f;

// (units > 0) Defines how "disocclusionThreshold" blends into "disocclusionThresholdAlternate" = pixelSize / (pixelSize + strandThickness)
float strandThickness = 80e-6f;

// [0; 1] - enables "noisy input / denoised output" comparison
float splitScreen = 0.0f;

Expand All @@ -142,7 +153,7 @@ namespace nrd
// To reset history set to RESTART / CLEAR_AND_RESTART for one frame
AccumulationMode accumulationMode = AccumulationMode::CONTINUE;

// If "true" IN_MV is 3D motion in world-space (0 should be everywhere if the scene is static),
// If "true" IN_MV is 3D motion in world-space (0 should be everywhere if the scene is static, camera motion must not be included),
// otherwise it's 2D (+ optional Z delta) screen-space motion (0 should be everywhere if the camera doesn't move) (recommended value = true)
bool isMotionVectorInWorldSpace = false;

Expand All @@ -167,8 +178,7 @@ namespace nrd
// f = ( A + viewZ * B ) * lerp( 1.0, C, exp2( D * roughness ^ 2 ) ), see "NRD.hlsl/REBLUR_FrontEnd_GetNormHitDist"
struct HitDistanceParameters
{
// (units) - constant value
// IMPORTANT: if your unit is not "meter", you must convert it from "meters" to "units" manually!
// (units > 0) - constant value
float A = 3.0f;

// (> 0) - viewZ based linear scale (1 m - 10 cm, 10 m - 1 m, 100 m - 10 m)
Expand Down Expand Up @@ -213,8 +223,8 @@ namespace nrd
// (pixels) - min denoising radius (for converged state)
float minBlurRadius = 1.0f;

// (pixels) - max denoising radius (gets reduced over time, 30 is a baseline for 1440p)
float maxBlurRadius = 15.0f;
// (pixels) - base (max) denoising radius (gets reduced over time)
float maxBlurRadius = 30.0f;

// (normalized %) - base fraction of diffuse or specular lobe angle used to drive normal based rejection
float lobeAngleFraction = 0.2f;
Expand All @@ -225,16 +235,24 @@ namespace nrd
// [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)
// (normalized %) - stabilizes output, but adds temporal lag, at the same time more stabilization improves antilag (clean signals can use lower values)
// = N / (1 + N), where N is the number of accumulated frames
// 0 - disables the stabilization pass
float stabilizationStrength = 1.0f;
float stabilizationStrength = 1.0f; // TODO: replace with number of accumulated frames

// (normalized %) - same as "stabilizationStrength", but for hit distance (can't be > "stabilizationStrength", 0 - allows to reach parity with REBLUR_OCCLUSION)
// = N / (1 + N), where N is the number of accumulated frames
float hitDistanceStabilizationStrength = 1.0f; // TODO: replace with number of accumulated frames

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

// IN_MV = lerp(IN_MV, specularMotion, smoothstep(this[0], this[1], specularProbability))
float specularProbabilityThresholdsForMvModification[2] = {0.5f, 0.9f};

// [1; 3] - undesired sporadic outliers suppression to keep output stable (smaller values maximize suppression in exchange of bias)
float fireflySuppressorMinRelativeScale = 2.0f;

// If not OFF and used for DIFFUSE_SPECULAR, defines diffuse orientation, specular orientation is the opposite
CheckerboardMode checkerboardMode = CheckerboardMode::OFF;

Expand All @@ -247,7 +265,7 @@ namespace nrd
// Boosts performance by sacrificing IQ
bool enablePerformanceMode = false;

// Spatial passes do optional material index comparison as: ( materialEnabled ? material[ center ] == material[ sample ] : 1 )
// Optional material index comparison: enableMaterialTest ? materialID[x] == materialID[y] : 1 (requires "NormalEncoding::R10_G10_B10_A2_UNORM")
bool enableMaterialTestForDiffuse = false;
bool enableMaterialTestForSpecular = false;

Expand Down Expand Up @@ -361,7 +379,7 @@ namespace nrd
// Roughness based rejection
bool enableRoughnessEdgeStopping = true;

// Spatial passes do optional material index comparison as: ( materialEnabled ? material[ center ] == material[ sample ] : 1 )
// Optional material index comparison: enableMaterialTest ? materialID[x] == materialID[y] : 1 (requires "NormalEncoding::R10_G10_B10_A2_UNORM")
bool enableMaterialTestForDiffuse = false;
bool enableMaterialTestForSpecular = false;
};
Expand All @@ -379,7 +397,8 @@ namespace nrd

// (normalized %) - stabilizes output, more stabilization improves antilag (clean signals can use lower values)
// 0 - disables the stabilization pass and makes denoising spatial only (no history)
float stabilizationStrength = 1.0f;
// = N / (1 + N), where N is the number of accumulated frames
float stabilizationStrength = 1.0f; // TODO: replace with number of accumulated frames
};

// REFERENCE
Expand Down
2 changes: 1 addition & 1 deletion Integration/NRDIntegration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void NrdIntegration::CreateResources(uint16_t resourceWidth, uint16_t resourceHe

// Adjust memory usage
nri::MemoryDesc memoryDesc = {};
m_NRI->GetTextureMemoryInfo(*texture, nri::MemoryLocation::DEVICE, memoryDesc);
m_NRI->GetTextureMemoryDesc(*m_Device, textureDesc, nri::MemoryLocation::DEVICE, memoryDesc);

if (i < instanceDesc.permanentPoolSize)
m_PermanentPoolSize += memoryDesc.size;
Expand Down
Loading

0 comments on commit 1762023

Please sign in to comment.