Skip to content

Conversation

slunity
Copy link
Contributor

@slunity slunity commented Jun 20, 2021

Please read the Contributing guide before making a PR.

Checklist for PR maker

  • Have you added a backport label (if needed)? For example, the need-backport-* label. After you backport the PR, the label changes to backported-*.
  • Have you updated the changelog? Each package has a CHANGELOG.md file.
  • Have you updated or added the documentation for your PR? When you add a new feature, change a property name, or change the behavior of a feature, it's best practice to include related documentation changes in the same PR. If you do add documentation, make sure to add the relevant Graphics Docs team member as a reviewer of the PR. If you are not sure which person to add, see the Docs team contacts sheet.
  • Have you added a graphic test for your PR (if needed)? When you add a new feature, or discover a bug that tests don't cover, please add a graphic test.

Purpose of this PR

Why is this PR needed, what hard problem is it solving/fixing?

Wip: this can be split in multiple PRs.

Essentially bugfixes for raytracing reflections, and a fallback mode for ray misses.


Testing status

Describe what manual/automated tests were performed for this PR


Comments to reviewers

Notes for the reviewers you have assigned.

slunity added 12 commits June 18, 2021 00:15
… coatmask usage consistency between forward and deferred.
… non lerped light sampling parameters formulation (here fed from normaldata) but lerped both FGD and reflectionHierarchyWeight headroom left with coatmask.
…ing just ignores SSR-RTR light as coatMask goes to 0.
-Fix indirect light hitting StackLit materials having wrong color for indirect ambient illumination.
-Fix indirect light hitting StackLit materials not showing any specular response.
…aterials. This will only show with multi bounce indirect (so with RTR quality mode with a bounce count >= 2).

-Make Lit secondary reflections also consider coat like StackLit and AxF
-Fix Lit, AxF, StackLit: to use proper specular BSDF lobe sampling when a coat is present.
-RaytracingLightLoop EvaluateBSDF_RaytracedReflection() material callback now allow reflectionHierarchyWeight to be modified.
This allows secondary reflections to properly deal with coated materials similarly to what the analogous EvaluateBSDF_ScreenSpaceReflection() callbacks (of the main lighting LightLoop) already can do, by using a (possibly integrated) Fresnel term to modulate it. See for example LitRaytracing.hlsl.

-Both light loops now also have an opt-in (no performance hit - this is pruned by the compiler) mechanism to allow more refined reflection light hierarchies for coated/layered BSDF materials: a single reflectionHierarchyWeight is still used by the light loops, but a material can internally track the other layer weight and return eg a minimum through the main reflectionHierarchyWeight to the ligjht loop.
This has many benefits:
  -Prevent overbright doubling of fresnel intensity for coat when using SSR-RTR lighting as there's now a way for the material to properly track the SSR-RTR contribution outside of its wanted lightprobe fallback (for performance reasons with SSR-RTR we can only sample one lobe roughness and direction)
  -For materials that can have different lobe directions, it allows the indirect specular lighting callbacks (ie EvaluateBSDF_Env() ) to allow further lightprobe evaluations when even one of the lobes have a fully used hierarchy. This can prevent subtle reflection artifacts for non trivial light probes setups with materials with different lobe directions.
…ection position calculations.

-In the deferred reflection lighting compute, a subtle issue existed where the depth loaded in half res was not necessarily the same as in every other passes eg for the ray launch contrary to the comments (RaytracingReflections.compute to generate directions, RaytracingGBuffer.raytrace for the raygen, RaytracingReflectionFilter.compute for the light weights and upscale)
-Also add defines for magic values in ray intersection distance buffer
-Add some notes about early out conditions
… for the denoiser logic. Also fix uninitialized deferred (performance) light reflections adjustweight kernel (it was kernel # 0 so it worked).

-The coatmask was ignored in the denoiser, which made the base smoothness affect the denoising of the raytraced coat reflections
-fix uninitialized deferred (performance mode) light reflections adjustweight kernel (it was kernel # 0 so it worked).
-In quality mode, also add internally an option to consider AffectSmoothSurfaces accumulation flag to escape sampling in the ray dispatch if we're going to use a single sample and skip the temporal accumulation later
…ways use the pre-integrated probes or sky even with raytraced reflections.
…riables are corrupted (eg _RayTracingFallbackHierarchy). Seems to happen under certain scene config (seems more repeatable with 0503d1f)
@slunity slunity changed the title [HDRP][SSR-RTR] [HDRP][SSR-RTR] Fallback mode for ray miss and various bugfixes. Jun 20, 2021
@sebastienlagarde sebastienlagarde self-requested a review July 22, 2021 15:25
slunity added a commit that referenced this pull request Oct 21, 2021
…te weight for coat and base lobe to correctly fallback from SSR light to light reflection probes and also implement the same coat-traced light "reuse" as Lit for bottom lobe when roughnesses are similar.

This also cleans up the overlapping contributing reflection probes / dual normal setup problem in EvaluateBSDF_Env().
Based on previously discussed #4968.
slunity added a commit that referenced this pull request Oct 21, 2021
Add support for more refined reflection hierarchy for SSR-RTR blending with IBL and to avoid double coat lighting.
This is mainly based on #4968, but with the added feature to re-use the coat-traced light for similarly-rough bottom layer lobes, like done for Lit.

This fixes several issues in the implementation in StackLit since #5565:

-Similar issues fixed for Lit (see other PR for Lit)
-StackLit can have a rough coat, but an arbitrary 0.9 smoothness value was used to decide if the coat-traced light would be re-used for the bottom lobes.
-The wrong bottom lobe roughnesses were used (values that don't include the effect of BRDF vertical layering computations)
-StackLit can have different lobe directions and the light hierarchy now account for this.
@anisunity anisunity closed this Nov 10, 2021
sebastienlagarde added a commit that referenced this pull request Nov 22, 2021
Add support for more refined reflection hierarchy for SSR-RTR blending with IBL and to avoid double coat lighting.
This is mainly based on #4968, but with the added feature to re-use the coat-traced light for similarly-rough bottom layer lobes, like done for Lit.

This fixes several issues in the implementation in StackLit since #5565:

-Similar issues fixed for Lit (see other PR for Lit)
-StackLit can have a rough coat, but an arbitrary 0.9 smoothness value was used to decide if the coat-traced light would be re-used for the bottom lobes.
-The wrong bottom lobe roughnesses were used (values that don't include the effect of BRDF vertical layering computations)
-StackLit can have different lobe directions and the light hierarchy now account for this.

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
sebastienlagarde pushed a commit that referenced this pull request Nov 22, 2021
…te weight for coat and base lobe to correctly fallback from SSR light to light reflection probes and also implement the same coat-traced light "reuse" as Lit for bottom lobe when roughnesses are similar. (#6108)

This also cleans up the overlapping contributing reflection probes / dual normal setup problem in EvaluateBSDF_Env().
Based on previously discussed #4968.
sebastienlagarde pushed a commit that referenced this pull request Dec 8, 2021
…te weight for coat and base lobe to correctly fallback from SSR light to light reflection probes and also implement the same coat-traced light "reuse" as Lit for bottom lobe when roughnesses are similar. (#6108)

This also cleans up the overlapping contributing reflection probes / dual normal setup problem in EvaluateBSDF_Env().
Based on previously discussed #4968.
sebastienlagarde added a commit that referenced this pull request Dec 8, 2021
* Fixed references to probes not cleared when unloading a scene #5945

* [Fogbugz # 1365368] Fixing debug views for drs #5948

* [HDRP] Stacklit RTR: Fix issues with RTR reflections from stacklit materials #6103

* [HDRP] Lit coat ssr-rtr: Fix various issues with using SSR lighting with IBL fallback (case 1380351) #6106

* [HDRP] StackLit coat ssr-rtr light hierarchy and IBL fallback fixes. #6107

* AxF ssr-rtr: Implement refined light reflection hierarchy with separate weight for coat and base lobe to correctly fallback from SSR light to light reflection probes and also implement the same coat-traced light "reuse" as Lit for bottom lobe when roughnesses are similar. (#6108)

This also cleans up the overlapping contributing reflection probes / dual normal setup problem in EvaluateBSDF_Env().
Based on previously discussed #4968.

* Fix issue with reflection probe normalization via APV (#6140)

* fix issue

* -

* [not ready] HDRP Scene Template: Bumped up IET framework version to 2.1 and better default layout for 1080p monitors (#6153)

* bumped up iet framework to 2.1, created new 1080p and 4k friendly layout

* Merge branch 'master' into hdrp-template-bumpup-iet-framework-version

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] Fix custom pass utils in XR #6271

* Update reference screenshots

Co-authored-by: Adrien de Tocqueville <adrien.tocqueville@unity3d.com>
Co-authored-by: Kleber Garcia <kleber.garcia@unity3d.com>
Co-authored-by: slunity <37302815+slunity@users.noreply.github.com>
Co-authored-by: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com>
Co-authored-by: pierre-unity <39901544+pierre-unity@users.noreply.github.com>
Co-authored-by: Antoine Lelievre <antoinel@unity3d.com>
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