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

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

Merged
merged 3 commits into from
Nov 22, 2021

Conversation

slunity
Copy link
Contributor

@slunity slunity commented Oct 21, 2021


Purpose of this PR

See #6106

This implements more complex base/coat light reflection hierarchy as was done in #4968 but with the addition of the coat-traced light reuse for bottom for similarly-rough lobes on the bottom.

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.

Testing status

Tests in local test scene, see note below:


Comments to reviewers

Note that other incoming PRs might also change graphic test results, might be worth it to bundle them together instead of changing screenshots for each.

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.
@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://unity-ci.cds.internal.unity3d.com/project/902/
Search for your PR branch using the search bar at the top, 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
/jobDefinition/.yamato%2Fall-hdrp.yml%23PR_HDRP_trunk
With changes to HDRP packages, you should also run
/jobDefinition/.yamato%2Fall-lightmapping.yml%23PR_Lightmapping_trunk

SRP Core
You could run ABV on your branch before merging your PR, but it will start A LOT of jobs. Please be responsible about it and run it only when you feel the PR is ready:
/jobDefinition/.yamato%252F_abv.yml%2523all_project_ci_trunk
Be aware that any modifications to the Core package impacts everyone in the Graphics repo so please discuss the PR with your lead.

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.


if (perLightOption && haveAnisotropy)
{
basePerceptualRoughness[0] = preLightData.unmodifiedIblPerceptualRoughness[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use indices to reference coats when in relative space (when cannot be using BASE_LOBEA_IDX and BASE_LOBEB_IDX)? a bit confusing to follow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I've considered it since the beginning when I made these indices (between having yet another set for BASE_NB_LOBES sized arrays or just or 0-1), right now in the code everywhere where we process only BASE_NB_LOBES it is 0,1 so this addition is in line with that, but I can change it everywhere np.

// - The roughness is superior to bsdfData.coatPerceptualRoughness + 0.2.
// We cannot use the SSR for that base layer lobe.
// - The roughness is within <= 0.2 away of bsdfData.coatPerceptualRoughness, we lerp between the two behaviors.
float coatSSRLightOnBottomLayerBlendingFactor = lerp(1.0, 0.0, saturate( (basePerceptualRoughness[i] - bsdfData.coatPerceptualRoughness) / 0.2 ) );
Copy link
Contributor

Choose a reason for hiding this comment

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

need to run formatting on the branch i guess

Copy link
Contributor

@anisunity anisunity left a comment

Choose a reason for hiding this comment

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

Didn't read in depth, but looks good to me.

@anisunity anisunity marked this pull request as ready for review November 4, 2021 18:12
@sebastienlagarde sebastienlagarde merged commit dec915b into master Nov 22, 2021
@sebastienlagarde sebastienlagarde deleted the HDRP/stacklit-ssr-rtr-coat-fixes branch November 22, 2021 18:29
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