-
Notifications
You must be signed in to change notification settings - Fork 792
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
Conversation
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.
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. HDRP SRP Core 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]; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ) ); |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
* 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>
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:
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.