Skip to content

Conversation

Wilfrid-Unity
Copy link
Contributor

@Wilfrid-Unity Wilfrid-Unity commented Mar 11, 2021

Purpose of this PR

#2126 added to Universal RP support for custom shadow resolution for additional lights.
When a Universal RP project is upgraded to a Universal RP package containing those changes, its UniversalRenderPipeline Assets get new "Shadow Resolution Tiers" fields added with default values 256/512/1024 ; and its spot light shadows get assigned the lowest tier resolution.

The lower resolution might cause the visual quality of spot light shadows in a project to look worse after the upgrade.

This pull request ensures that after upgrade, spot light shadows will keep using the same resolution.
This is done by using the highest tier resolution as default.

Taking inspiration from@Verasl suggestion, during upgrade the 3 tier resolutions are also modified according to the additional light shadow atlas resolution set in the asset (respectively: full-res, half-res, quarter res if possible).


Testing status

In a test scene based on UniversalRP template scene added with shadowed spot lights, I locally checked that the changes in this pull request effectively conserve spot light shadow resolutions after the upgrade to Unity 2021.


Comments to reviewers

Effort tracked by internal ticket https://fogbugz.unity3d.com/f/cases/1316540

2021.2 Main pull-request: #3831

@github-actions
Copy link

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page)
and cancel any jobs that started on Yamato.
See the PR template for more information.
Thank you!

…lues if it seems that they have never been customized (@Verasl suggestion)
…ltShadowResolutionTier... constant definitions outside of #if UNITY_EDITOR block
…nsparentReceiveShadow spot light shadow resolution to higher tier to match previous settings
Copy link
Contributor

@Verasl Verasl left a comment

Choose a reason for hiding this comment

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

LGTM

@Verasl Verasl self-requested a review March 16, 2021 08:33
@Wilfrid-Unity Wilfrid-Unity requested a review from a team as a code owner April 7, 2021 07:34
…eiveShadow spot light shadow resolution to higher tier to match previous settings
@Wilfrid-Unity
Copy link
Contributor Author

Everything looks OK on both 2021.2 and 2021.1, I'm merging the pull requests.

@Wilfrid-Unity Wilfrid-Unity merged commit 8defff0 into 2021.1/staging Apr 9, 2021
@Wilfrid-Unity Wilfrid-Unity deleted the 2021.1/universal/additional-light-shadow-resolution-auto-upgrade branch April 9, 2021 03: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.

2 participants