This guide has been designed to simplify migration to a newer version.
(based on v2.12)
NRD_USE_MATERIAL_ID_AWARE_FILTERINGrenamed toNRD_USE_MATERIAL_IDNRD_NORMAL_ENCODINGsimplified toNRD_NORMAL_ENCODING_UNORMandNRD_NORMAL_ENCODING_OCTNRD_MATERIAL_ID_AWARE_FILTERINGrenamed toNRD_USE_MATERIAL_ID- changed parameters in
NRD_GetCorrectedHitDist - REFERENCE:
- denoiser input & output changed to dedicated
IN_RADIANCEandOUT_RADIANCE
- denoiser input & output changed to dedicated
- REBLUR:
- settings collapsed to
ReblurSettingsshared across all REBLUR denoisers LobeTrimmingParametersrenamed toSpecularLobeTrimmingParametersnormalWeightStrictnessreplaced bylobeAngleFraction(a different value with similar meaning)materialMaskreplaced withenableMaterialTestForDiffuseandenableMaterialTestForSpecular- exposed
minConvergedStateBaseRadiusScale - exposed
roughnessFraction - exposed
responsiveAccumulationRoughnessThreshold - exposed
inputMix - exposed
enablePerformanceMode
- settings collapsed to
- RELAX:
rejectDiffuseHistoryNormalThresholdrenamed todiffuseHistoryRejectionNormalThresholdenableSkipReprojectionTestWithoutMotionrenamed toenableReprojectionTestSkippingWithoutMotionphiNormalreplaced bydiffuseLobeAngleFraction(a different value with similar meaning)- exposed
roughnessFraction - exposed
enableMaterialTest
NRD requires explicit definitions of NRD_USE_OCT_NORMAL_ENCODING and NRD_USE_MATERIAL_ID to avoid a potential confusion when NRD was compiled using one set of values, but an application uses other values. The CMake file has been modified to simplify NRD integration into projects, where it is used as a Git submodule. Now these macro definitions are exposed as Cmake options.
- removed
PrePassMode - added
maxSupportedMaterialBitNumandisCompiledWithOctPackNormalEncodingtoLibraryDesc - added optional
worldPrevToWorldMatrixtoCommonSettings - REBLUR:
- exposed
diffusePrepassBlurRadiusandspecularPrepassBlurRadius - exposed
enableAdvancedPrepassmatching previously usedPrePassMode::ADVANCED - exposed
enableHitDistanceReconstruction
- exposed
- RELAX:
- removed
diffuseHistoryRejectionNormalThreshold - removed
minLuminanceWeightand added separateddiffuseMinLuminanceWeightandspecularMinLuminanceWeight - exposed
enableSpecularHitDistanceReconstruction
- removed
- exposed
HitDistanceReconstructionMode - REBLUR:
enableHitDistanceReconstructionreplaced withhitDistanceReconstructionMode- removed
residualNoiseLevel
- RELAX:
enableSpecularHitDistanceReconstructionreplaced withhitDistanceReconstructionMode
- exposed
REBLUR_DIFFUSE_SH,REBLUR_SPECULAR_SHandREBLUR_DIFFUSE_SPECULAR_SHdenoisers - NRD.hlsli:
REBLUR_FrontEnd_PackRadianceAndHitDistrenamed toREBLUR_FrontEnd_PackRadianceAndNormHitDistREBLUR_FrontEnd_PackDirectionAndHitDistrenamed toREBLUR_FrontEnd_PackDirectionAndNormHitDistREBLUR_BackEnd_UnpackRadianceAndHitDistrenamed toREBLUR_BackEnd_UnpackRadianceAndNormHitDistREBLUR_BackEnd_UnpackDirectionAndHitDistrenamed toREBLUR_BackEnd_UnpackDirectionAndNormHitDistRELAX_BackEnd_UnpackRadianceAndHitDistrenamed toRELAX_BackEnd_UnpackRadiance- removed
NRD_GetCorrectedHitDist
- API:
- exposed miscellaneous function
GetMethodString
- exposed miscellaneous function
- REBLUR:
- removed
inputMix
- removed
- RELAX:
- exposed
confidenceDrivenRelaxationMultiplier - exposed
confidenceDrivenLuminanceEdgeStoppingRelaxation - exposed
confidenceDrivenNormalEdgeStoppingRelaxation
- exposed
- NRD.hlsli:
REBLUR_FrontEnd_PackDirectionAndNormHitDistrenamed toREBLUR_FrontEnd_PackDirectionalOcclusion
- REBLUR:
- exposed
historyFixFrameNum - exposed
historyFixStrideBetweenSamples - removed
historyFixStrength
- exposed
- RELAX:
disocclusionFixEdgeStoppingNormalPowerrenamed tohistoryFixEdgeStoppingNormalPowerdisocclusionFixMaxRadiusrenamed tohistoryFixStrideBetweenSamplesdisocclusionFixNumFramesToFixrenamed tohistoryFixFrameNum
- REBLUR:
- Removed
SpecularLobeTrimmingParameters
- Removed
- NRD.hlsli:
- Removed
NRD_GetTrimmingFactor
- Removed
NRD_USE_OCT_NORMAL_ENCODING and NRD_USE_MATERIAL_ID replaced with more explicit NRD_NORMAL_ENCODING and NRD_ROUGHNESS_ENCODING to offer more encoding variants out of the box.
- API:
- removed
maxSupportedMaterialBitNumandisCompiledWithOctPackNormalEncodingfromLibraryDesc - added
normalEncodingandroughnessEncodingtoLibraryDesc
- removed
- REBLUR:
- Removed
enableAdvancedPrepass
- Removed
Introduced optional NRDEncoding.hlsli file which can be included prior NRD.hlsli to properly setup NRD encoding for usage outside of NRD project, if encoding variants are not set via Cmake parameters. Also introduced optional IN_DISOCCLUSION_THRESHOLD_MIX which allows to smoothly mix CommonSettings::disocclusionThreshold (0) into CommonSettings::disocclusionThresholdAlternate (1).
- API:
- Exposed
IN_DISOCCLUSION_THRESHOLD_MIX,CommonSettings::disocclusionThresholdAlternate&CommonSettings::isDisocclusionThresholdMixAvailable
- Exposed
- REBLUR:
- Removed
minConvergedStateBaseRadiusScale - Removed
maxAdaptiveRadiusScale
- Removed
Introduced optional OUT_VALIDATION output, which contains debug visualization layer if CommonSettings::enableValidation = true.
- API:
- Removed
DenoiserCreationDesc::enableValidation - Exposed
CommonSettings::enableValidation - Extened
CommonSettings::motionVectorScaleto 3 floats
- Removed
Since NRD tracks specular motion, now, if requested, it can modify provided diffuse-like motion in IN_MV with internally computed specular-like motion if specularity is high. For this purpose an optional IN_BASECOLOR_METALNESS input has been added. This feature improves behavior of spatio-temporal upscalers, like TAA or DLSS.
- API:
- Introduced
CommonSettings::isBaseColorMetalnessAvailable - Reworked
DenoiserDescto clearly indicate that there are 3 types of resources each of which "sits" in a predefinedspace(setin VK):- constant buffer - binding is shared across all pipelines
- samplers - bindings are shared across all pipelines
- resources - bindings vary per pipeline
- Name changes:
isHistoryConfidenceInputsAvailable=>isHistoryConfidenceAvailableResource=>ResourceDescDescriptorRangeDesc=>ResourceRangeDescComputeShader=>ComputeShaderDescDescriptorSetDesc=>DescriptorPoolDesc- all
fooNum=>foosNum
GetComputeDispatchesreturn type changed tovoid
- Introduced
- REBLUR:
- Exposed
specularProbabilityThresholdsForMvModificationto control diffuse / specular motion mixing
- Exposed
- RELAX:
- Removed
enableSpecularVirtualHistoryClamping
- Removed
SH (spherical harmonics) have been replaced with SG (spherical gaussians). It unlocks physically-based high quality diffuse & specular resolve. The following functions have been added to NRD.hlsli (or renamed):
NRD_SG_ExtractColor- extracts unresolved denoised radianceNRD_SG_ExtractDirection- extracts light dominant directionNRD_SG_ExtractRoughnessAA- extracts modified roughness (increased in areas with high normal variance)NRD_SG_ResolveDiffuse- reconstructs diffuse macro detailsNRD_SG_ResolveSpecular- reconstructs specular macro detailsNRD_SG_ReJitter- reconstructs diffuse & specular micro details (resurrects jitter vanished out after denoising)NRD_SH_ResolveDiffuse- reconstructs diffuse macro details using SH resolve (for comparison only)NRD_SH_ResolveSpecular- reconstructs specular macro details using SH resolve (for comparison only)
A single NRD instance can now include any combination of denoisers, including repeating ones (for example, RELAX_DIFFUSE, RELAX_DIFFUSE and SIGMA_SHADOW). Transient memory pool is internally optimized to reduce memory consumption.
- API:
- Introduced
Identifierto distinguish one denoiser in the instance from another one - Introduced
SetCommonSettings GetComputeDispatchesnow expects a list of identifiers, specifying which denoisers collect dispatches for- Added explicit
CommonSettings::cameraJitterPrevandCommonSettings::resolutionScalePrev(sinceSetCommonSettingscan be called several times per frame) - Name changes (including sub-name usages):
Denoiser=>InstanceMethod=>DenoiserfullResolutionWidth=>renderWidthfullResolutionHeight=>renderHeight
- Introduced
- NRD INTEGRATION:
- Introduced
NewFrame - Introduced
SetCommonSettings
- Introduced
- RELAX:
- Introduced
AntilagSettings
- Introduced
- REBLUR:
- Removed
enableReferenceAccumulation - Introduced
usePrepassOnlyForSpecularMotionEstimation AntilagIntensitySettingsandAntilagHitDistanceSettingsreplaced with simplerReblurAntilagSettings
- Removed
- API:
inputSubrectOrigin=>rectOriginand clarified usage- improved dynamic resolution scaling support: now not only viewport can be adjusted on the fly, but resources can be suballocated from a heap on the fly too
- removed
DenoiserDesc::renderWidthandDenoiserDesc::renderHeight - removed
CommonSettings::resolutionScaleandCommonSettings::resolutionScalePrev - exposed
CommonSettings::resourceSizeandCommonSettings::resourceSizePrev - exposed
CommonSettings::rectSizeandCommonSettings::rectSizePrev - NRD INTEGRATION: currently statically allocates resources at NRD instance creation time
- removed
- all denoisers use resources without mips:
- removed
TextureDesc::mipNum - removed
ResourceDesc::mipNumandResourceDesc::mipOffset
- removed
- simplified number of samplers
- removed
Sampler::NEAREST_MIRRORED_REPEATandSampler::LINEAR_MIRRORED_REPEAT
- removed
- NRD.hlsli:
- added
NRD_FrontEnd_SpecHitDistAveraging_Xfunctions, needed to properly average specular hit distance for correct specular tracking in case of many RPP NRD_INPUT/OUTPUT_TEXTURE_STARTrenamed toNRD_INPUTS/OUTPUTS_STARTNRD_INPUT/OUTPUT_TEXTURErenamed toNRD_INPUT/OUTPUTNRD_INPUT/OUTPUT_TEXTURE_ENDrenamed toNRD_INPUTS/OUTPUTS_ENDNRD_SAMPLER_START/ENDrenamed toNRD_SAMPLERS_START/END
- added
- REBLUR:
- removed
historyFixStrideBetweenSamples
- removed
- RELAX:
- removed
historyFixStrideBetweenSamples - removed
enableReprojectionTestSkippingWithoutMotion
- removed
- REFERENCE:
IN_RADIANCErenamed toIN_SIGNALOUT_RADIANCErenamed toOUT_SIGNAL
- API:
ResourceDesc::stateNeededrenamed toResourceDesc::descriptorTypeto matchResourceRangeDesc::descriptorTypebecause the former is a concatenation of the latter
- REBLUR:
blurRadiusrenamed tomaxBlurRadius- exposed
minBlurRadiuswith the default value matching older versions
- SIGMA:
- removed
blurRadiusScale - exposed
lightDirection, which is needed only for directional light sources - exposed
stabilizationStrength - clarified usage:
float shadow = SIGMA_BackEnd_UnpackShadow( OUT_SHADOW_TRANSLUCENCY );float3 translucentShadow = SIGMA_BackEnd_UnpackShadow( OUT_SHADOW_TRANSLUCENCY ).yzw;
- removed
- API:
- exposed
CommonSettings::viewZScaleimproving FP16viewZsupport
- exposed
- SIGMA:
- explicitly uses
IN_VIEWZinstead of storingviewZinIN_SHADOWDATA IN_SHADOWDATArenamed toIN_PENUMBRA(describes penumbra properties)IN_SHADOW_TRANSLUCENCYrenamed toIN_TRANSLUCENCY(describes optional translucency)SIGMA_FrontEnd_PackShadowhas been explicitly separated into 2 functions:IN_SHADOWDATA:SIGMA_FrontEnd_PackPenumbra(2 variants: for infinite and local light sources)IN_SHADOW_TRANSLUCENCY:SIGMA_FrontEnd_PackTranslucency
- explicitly uses
- Deprecated and removed with all dependencies:
SPECULAR_REFLECTION_MVSPECULAR_DELTA_MV
- API:
MemoryAllocatorInterfacerenamed toAllocationCallbacks- exposed
CommonSettings::strandMaterialID, enabling "under-the-hood" tweaks for hair (and grass) denoising - exposed
CommonSettings::strandThickness, defining how NRD adapts to sub-pixel thick details. It works in conjunction withCommonSettings::disocclusionThresholdAlternateforCommonSettings::strandMaterialIDwithout a need to provideIN_DISOCCLUSION_THRESHOLD_MIXtexture
- REBLUR:
- changed usage of
maxBlurRadiusand its default value, old values should be scaled by2 - exposed
hitDistanceStabilizationStrengthallowing to control the responsiviness of ambient and specular occlusion in the temporal stabilization pass and reach parity withREBLUR_OCCLUSIONif set to0
- changed usage of
- NRD INTEGRATION:
Nrdprefix replaced withnrd::namespace- removed
formatfromNrdIntegrationTexture, which is now justnri::TextureBarrierDesc - removed the constructor with arguments
- creation parameters grouped into
IntegrationCreationDesc, which need to be passed toInitialize - added a few potentially useful flags to
IntegrationCreationDesc
- API:
- exposed
DEFAULT_ACCUMULATION_TIMEfor all denoisers - added some missing
MAX_HISTORY_FRAME_NUMconstants - exposed
GetMaxAccumulatedFrameNumhelper, converting time to frames
- exposed
- REBLUR:
stabilizationStrengthreplaced withmaxStabilizedFrameNumhitDistanceStabilizationStrengthreplaced withmaxStabilizedFrameNumForHitDistanceluminanceAntilagPowerreplaced withluminanceSensitivityhitDistanceAntilagPowerreplaced withhitDistanceSensitivity- tweaked the default values for
ReblurAntilagSettings - the new default value for
planeDistanceSensitivity = 0.02matches the behavior for the old value0.005 - slightly reduced
lobeAngleFractionto squeeze more normal details (it's safe to use the old value0.2)
- SIGMA:
stabilizationStrengthreplaced withmaxStabilizedFrameNum- the new default value for
planeDistanceSensitivity = 0.02matches the behavior for the old value0.005
- REBLUR/RELAX:
- (re)introduced
historyFixBasePixelStrideto maximize flexibility (the default matches old behavior)
- (re)introduced
- REBLUR/RELAX:
- added
minHitDistanceWeight
- added
- REBLUR/RELAX:
enableMaterialTestForDiffusereplaced withminMaterialForDiffuse(the default matches old behavior)enableMaterialTestForSpecularreplaced withminMaterialForSpecular(the default matches old behavior)
- REBLUR:
- Disabled temporal stabilization for
hitT:- removed
ReblurAntilagSettings::hitDistanceSigmaScaleandReblurAntilagSettings::hitDistanceSensitivity - removed
maxStabilizedFrameNumForHitDistance
- removed
- output textures are not used as history buffers on the next frame anymore
- Disabled temporal stabilization for
- API:
- removed
ResourceRangeDesc::baseRegisterIndexand added globalInstanceDesc::resourcesBaseRegisterIndex - spaces for constant buffer and resources merged into a single
InstanceDesc::constantBufferAndResourcesSpaceIndex - reworked
DescriptorPoolDesc
- removed
- API:
NRDEncoding.hlslirenamed toNRDConfig.hlsliand included intoNRD.hlsli(now includes more compile time constants)- removed
DescriptorPoolDesc::totalConstantBuffersNumandDescriptorPoolDesc::totalSamplersNum. If root (immutable) samplers and root (push) descriptor are not used, this can be deduced fromDescriptorPoolDesc::setMaxNumand clarifying comments - merged register spaces for samplers and constant buffers into
InstanceDesc::constantBufferAndSamplersSpaceIndex - renamed register space for resources (SRVs and UAVs) to
InstanceDesc::resourcesSpaceIndex - separated base registers for constant buffer, samplers and resources in
InstanceDesc - removed
InstanceDesc::samplersInSeparateSet - moved
PipelineDesc::shaderEntryPointtoInstanceDesc - added
CommonSettings::historyFixAlternatePixelStrideMaterialIDallowing to usehistoryFixAlternatePixelStridefor a specific material ID - replaced
PipelineDesc::shaderFileNamewithshaderIdentifier(including shader name and permutation macros) - reworked
GetLibraryDescandGetInstanceDescto return a pointer instead of a reference to be conformant with "C" linkage
- NRD INTEGRATION:
- expects unique register spaces
- REBLUR:
- added
returnHistoryLengthInsteadOfOcclusion - added
historyFixAlternatePixelStride - exposed previously hidden
fastHistoryClampingSigmaScale(the default matches old behavior) - responsive accumulation settings extended and grouped into
ResponsiveAccumulationSettings
- added
- RELAX:
- diffuse history length is returned in ".w"
- added
historyFixAlternatePixelStride historyClampingColorBoxSigmaScalerenamed tofastHistoryClampingSigmaScale(no changes in meaning)
- API:
IN_DIFF_CONFIDENCEandIN_SPEC_CONFIDENCEcan be provided at lower resolution (linearly upscaled)- added "HISTORY CONFIDENCE" section to README
- removed
NRD_SG_ExtractRoughnessAA(never used outside of the sample, led to mismatches between "in" and "out" material demodulation factors)
- REBLUR:
HitDistanceParametersrenamed toReblurHitDistanceParameters(no changes in meaning)- removed
ReblurHitDistanceParameters::D, which was a left over from antient times (smcis used instead under the hood, it's a remappedroughness) - removed
NRD_SUPPORTS_BASECOLOR_METALNESS,CommonSettings::isBaseColorMetalnessAvailableandResourceType::IN_BASECOLOR_METALNESS(modern upscaling techniques work well with common (surface) motion, the idea of MV patching was largely misunderstood and misused, additionally, patching was not optimal for pixels containing 50% diffuse and 50% of specular) ReblurResponsiveAccumulationSettingsrenamed toReblurReblurResponsiveAccumulationSettings(no changes in meaning)- added
ReblurConvergenceSettings
- API:
- renamed
CommonSettings::rectOrigintoCommonSettings::inputRectOriginand applied it toIN_resources, excludingIN_DIFF_CONFIDENCE,IN_SPEC_CONFIDENCEandIN_DISOCCLUSION_THRESHOLD_MIX - added
CommonSettings::outputRectOrigin, enabled byNRD_SUPPORTS_VIEWPORT_OFFSET. It is applied to allOUT_resources and resources fromPERMANENT_POOLon both reads and writes, including previous-frame history. Changing it assumesAccumulationMode::CLEAR_AND_RESTART - added
CommonSettings::motionVectorBiasfor post-scale unpacking and de-jittering ofIN_MV - clarified
GetMaxAccumulatedFrameNumusage: pass low pass filtered FPS to keep the accumulation duration stable
- renamed
- REBLUR:
- Validation: added projection matrix jittering detection to the "jitter" nano viewport
- REBLUR/RELAX:
- Validation: added likely
IN_MVjittering detection to the "MV" viewport
- Validation: added likely
- Custom shader compilation:
NRD_INPUTandNRD_OUTPUTnow takepolicyas the 6th argument and must invokeNRD_DECLARE_RESOURCE
- since v4.16
NRDConfig.hlsliis included into every shader (includingNRD.hlsli), delivering shared compile-time options. So there is no need to "copy-paste" anything from CMake PipelineDesc::shaderIdentifierdefines a shader permutation asfileName|macro1=value1|macro2=value2...(or justfileName, no whitespace characters)- the entry point is provided in
InstanceDesc::shaderEntryPoint(same asNRD_CS_MAINmacro) - an array of macro definitions needs to be passed to a custom shader build system alongside with the file name
- (offline) an application can loop through all pipelines in the NRD instance to gather all permutations and compile them via a custom shader build system
- (runtime)
PipelineDesc::shaderIdentifiershould be used to identify and provide a shader permutation NRD is asking for, since embedded shaders can't be used