Skip to content

Conversation

remi-chapelain
Copy link
Contributor

@remi-chapelain remi-chapelain commented Aug 24, 2021

Purpose of this PR

Fixes this issue.
This recently merged PR added the possibility to use half resolution denoiser for SSGI.
In HDTemporalFilter.cs, in the Denoiser function the new parameter fullResolution was set via the filterParams.
However, the full resolution parameter was not set in the temporal denoiser function leading to rendering the temporal part in half resolution thus breaking Punctual and Directional ray traced shadows denoiser. (Area light were not impacted)

Before fix
beforeFix

After fix
afterFix


Testing status

  • Tested all light type with ray traced shadows. ✔️
  • Tested multiple RTShadows at the same time ✔️
  • Also tested the options in RTShadows (Color shadows, Semi Transparent shadows, Distance based denoising) ✔️
  • Tested in play mode with moving objects and lights to ensure accumulation is working as expected ✔️
  • Tested that SSGI full and half resolution was working correctly ✔️
  • All DXR tests are now green locally. ✔️

Comments to reviewers

Fix seems "trivial" to me but since I'm not familiar with the codebase, I'd love to have some feedback if the fix makes sense to someone who actually knows how it has been written. Might be a more clean / elegant / robust fix.

@github-actions
Copy link

Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed.
Link to Yamato: https://yamato.cds.internal.unity3d.com/jobs/902-Graphics
Search for your PR branch using the sidebar on the left, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

HDRP
/.yamato%252Fall-hdrp.yml%2523PR_HDRP_2021.2

Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure.

@github-actions github-actions bot added the HDRP label Aug 24, 2021
@remi-chapelain remi-chapelain changed the title probable fix [HDRP] Fix for punctua and directional ray traced shadow broken temporal denoiser Aug 24, 2021
@remi-chapelain remi-chapelain changed the title [HDRP] Fix for punctua and directional ray traced shadow broken temporal denoiser [HDRP] Fix for punctual and directional ray traced shadow broken temporal denoiser Aug 24, 2021
@remi-chapelain
Copy link
Contributor Author

Yamato's green

@remi-chapelain remi-chapelain marked this pull request as ready for review August 24, 2021 16:20
@remi-chapelain remi-chapelain requested a review from a team August 24, 2021 16:20
ctx.cmd.SetComputeTextureParam(data.temporalFilterCS, data.outputHistoryKernel, HDShaderIDs._IntermediateDenoiseOutputTexture, data.intermediateSignalOutput);
ctx.cmd.SetComputeTextureParam(data.temporalFilterCS, data.outputHistoryKernel, HDShaderIDs._DenoiseOutputArrayTextureRW, data.intermediateSignalOutput);
ctx.cmd.DispatchCompute(data.temporalFilterCS, data.outputHistoryKernel, numTilesX, numTilesY, data.viewCount);
CoreUtils.SetKeyword(ctx.cmd, "FULL_RESOLUTION_INPUT", true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: this code mean FULL_RESOLUTION_INPUT will always be true, even if we take another path later, is it what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not fully grasp the reason why this keyword is set to true after dispatch command. But, If I understand correctly, that's the default behavior (same is happening in the denoise() function above in the same file). Default is full res, unless we explicitly set to false before with the function parameter. The parameter (data.fullResolution) is only here for eventual future use but we always denoise ray traced shadows at full resolution anyway.

@sebastienlagarde
Copy link
Contributor

currently test are green, does it mean that we miss test that cover this cases? should we add one?

@remi-chapelain
Copy link
Contributor Author

remi-chapelain commented Aug 25, 2021

currently test are green, does it mean that we miss test that cover this cases? should we add one?

There are tests that cover this and what worries me is that locally all the tests using denoiser for punctual and directional fail (on master) but they seem to pass on Yamato for some reasons... :/

image

Example for 702_DirectionalShadowFiltering
d3cda5e5613e7814eec2338d9dc3e4ee

@remi-chapelain remi-chapelain changed the title [HDRP] Fix for punctual and directional ray traced shadow broken temporal denoiser [HDRP][DXR] Fix for punctual and directional ray traced shadow broken temporal denoiser Aug 27, 2021
Copy link
Contributor

@iM0ve iM0ve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the implementation is good code wise, no issues from QA side.

@anisunity
Copy link
Contributor

Incorrect, i'll change the code

@anisunity
Copy link
Contributor

The issue will only be triggered no RTGI, SSGI or RTAO is rendered before the the first shadow.

@anisunity
Copy link
Contributor

Fixed

@sebastienlagarde sebastienlagarde merged commit f90dae2 into master Sep 9, 2021
@sebastienlagarde sebastienlagarde deleted the HDRP/fix-1360132 branch September 9, 2021 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants