Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is NRD limited to 16 bits float textures? #83

Closed
StudenteChamp2 opened this issue Sep 22, 2024 · 3 comments
Closed

Is NRD limited to 16 bits float textures? #83

StudenteChamp2 opened this issue Sep 22, 2024 · 3 comments
Labels
question More a question, rather than an issue

Comments

@StudenteChamp2
Copy link

StudenteChamp2 commented Sep 22, 2024

From NRD.hlsli:

	// X => IN_DIFF_RADIANCE_HITDIST
	// X => IN_SPEC_RADIANCE_HITDIST
	float4 RELAX_FrontEnd_PackRadianceAndHitDist( float3 radiance, float hitDist, bool sanitize )
	{
	  if( sanitize )
		{
  		  radiance = _NRD_IsInvalid( radiance ) ? float3( 0, 0, 0 ) : clamp( radiance, 0, NRD_FP16_MAX );
  		  hitDist = _NRD_IsInvalid( hitDist ) ? 0 : clamp( hitDist, 0, NRD_FP16_MAX );
		}

	 return float4( radiance, hitDist );
	}

What will happen if i use 32 bits float textures?

@dzhdanNV
Copy link
Collaborator

What will happen if i use 32 bits float textures?

You can use FP32 if your radiance passed to NRD <= NRD_FP16_MAX.

Is NRD limited to 16 bits float textures?

Internal processing for radiance is FP16. But when creating NRD resources, including internal ones, you can replace RGBA16f to RGBA32f without problems. It can be done by modifying g_NRD_NrdToNriFormat, if you use the NRD integration layer.

@StudenteChamp2
Copy link
Author

Exellent thank you <3

@dzhdanNV dzhdanNV added the question More a question, rather than an issue label Oct 5, 2024
@dzhdanNV
Copy link
Collaborator

dzhdanNV commented Oct 9, 2024

NRD integration layer now supports FP16/FP32 promotion/demotion:

    // Demote FP32 to FP16 (slightly improves performance in exchange of precision loss)
    // (FP32 is used only for viewZ under the hood, all denoisers are FP16 compatible)
    bool demoteFloat32to16 = false;

    // Promote FP16 to FP32 (overkill, kills performance)
    bool promoteFloat16to32 = false;

Rarely needed, but still...

@dzhdanNV dzhdanNV closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question More a question, rather than an issue
Projects
None yet
Development

No branches or pull requests

2 participants