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

Added support for reflection probes as a fallback for ray traced reflections (case 1338644) #4809

Merged
merged 6 commits into from
Jun 16, 2021

Conversation

anisunity
Copy link
Contributor

@anisunity anisunity commented Jun 7, 2021

Added support for reflection probes as a fallback for ray traced reflections (case 1338644)
Fixed an issue where disbaled reflection probes were still sent into the the ray tracing light cluster.
When a ray hits the sky in the ray marching part of mixed ray tracing, it is considered a miss.
image
https://fogbugz.unity3d.com/f/cases/1338644/
Testing status
Added new tests to cover this new feature.
The previous tests are still green.

Copy link
Contributor

@remi-chapelain remi-chapelain left a comment

Choose a reason for hiding this comment

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

Thanks for adding the tests. ✊

I updated the "both" and the "reflection" because they were using the same diffusion profile so "both" was not tested in it. I modified the probe box size for the test "both" to be able to see the probe contribution and the sky on the same capture.

image

I also renamed the volumes to avoid confusion.

What I tested :

  • Perf Mode / Quality Mode
  • Checked if Layer masks were still functioning properly
  • Mixed mode
  • Denoiser

Tests are still green locally, also launched yamato.

One last thing before approving, even though it seems logical what do you think of changing "Reflection probe and Sky" to "Reflection Probe then Sky" to emphasize the fact than there is an order ?

@@ -176,7 +177,7 @@ static void RayMarchGBuffer(CommandBuffer cmd, in DeferredLightingRTRPassData da
cmd.SetComputeFloatParam(data.parameters.rayMarchingCS, HDShaderIDs._RayMarchingThicknessScale, thicknessScale);
cmd.SetComputeFloatParam(data.parameters.rayMarchingCS, HDShaderIDs._RayMarchingThicknessBias, thicknessBias);
cmd.SetComputeIntParam(data.parameters.rayMarchingCS, HDShaderIDs._RayMarchingSteps, data.parameters.raySteps);
cmd.SetComputeIntParam(data.parameters.rayMarchingCS, HDShaderIDs._RayMarchingReflectSky, data.parameters.raytracingCB._RaytracingIncludeSky);
cmd.SetComputeIntParam(data.parameters.rayMarchingCS, HDShaderIDs._RayMarchingReflectSky, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

is it expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is

Copy link
Contributor

@sebastienlagarde sebastienlagarde left a comment

Choose a reason for hiding this comment

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

I am not convince about the enum. Why to propose all the fallback mode?
If I understand correctly we just want to avoid cost of reflection fallback if we don't want it. But I think it introduce way to many settings, we should keep it simple.

I suggest just to be able to enable the fallback or reflection probe or not if performance is a concern but we always have the sky as a fallback. Thought? (And if adding the code of reflection probe don't imply cost (due to the dynamic branching and maybe because it doesn't add extra vgpr pressure), let's have it all the time.

@@ -229,6 +230,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed support of Distortion with MSAA
- Fixed contact shadow debug views not displaying correctly upon resizing of view.
- Fixed an error when deleting the 3D Texture mask of a local volumetric fog volume (case 1339330).
- Fixed an issue where disbaled reflection probes were still sent into the the ray tracing light cluster.
Copy link
Contributor

Choose a reason for hiding this comment

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

disbaled -> disabled

@anisunity
Copy link
Contributor Author

Found a bug in the wieght mixing code of the probes, need to fix it.

@@ -141,6 +141,11 @@ public int rayMaxIterations
#endregion

#region Ray Tracing
/// <summary>
/// When enabled, SSR handles sky reflection.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Out of date comment

anisunity and others added 3 commits June 14, 2021 15:59
…ections (case 1338644)

Fixed an issue where disbaled reflection probes were still sent into the the ray tracing light cluster.
When a ray hits the sky in the ray marching part of mixed ray tracing, it is considered a miss.
@anisunity
Copy link
Contributor Author

review fixes done

@sebastienlagarde sebastienlagarde marked this pull request as ready for review June 16, 2021 18:24
@sebastienlagarde sebastienlagarde merged commit c6aadb8 into master Jun 16, 2021
@sebastienlagarde sebastienlagarde deleted the HDRP/fix-1338644 branch June 16, 2021 20:42
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.

3 participants