Skip to content

Conversation

unity-cchu
Copy link
Contributor

@unity-cchu unity-cchu commented Oct 28, 2021

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 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

This fixes an issue where if a Light2D had been set shadows enabled, and then set it to a global light, it would cause layer batching to break. This was also an issue with the default global light in the 2D URP template.

https://fogbugz.unity3d.com/f/cases/1376487/
https://jira.unity3d.com/browse/D2D-3056

Testing status

I added an automated test for layer batching
This was also tested by our QA.

@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)

URP
/jobDefinition/.yamato%252Fall-urp.yml%2523PR_URP_trunk
With changes to URP packages, you should also run
/jobDefinition/.yamato%2Fall-lightmapping.yml%23PR_Lightmapping_trunk

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.

@BoonKiangTan
Copy link

BoonKiangTan commented Oct 29, 2021

Fix verified on branch:

2022.1.0a13.1822
Revision: trunk 5a5aca0fb632
Built: Sun, 17 Oct 2021 14:24:01 GMT
Package branch: 2d/Fix-For-Global-Light-Batching-Bug (2209a7b)

case 1376487: Verified only 1 Draw Dynamic call in Frame Debugger, capsules in scene are drawn together/batched
Unity_hjBTZxcxRS

@phi-lira phi-lira changed the base branch from master to universal/staging November 10, 2021 09:05
@phi-lira phi-lira merged commit 8a41597 into universal/staging Nov 10, 2021
@phi-lira phi-lira deleted the 2d/Fix-For-Global-Light-Batching-Bug branch November 10, 2021 09:05
@unity-cchu
Copy link
Contributor Author

Backport 2021.2:
#6888

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.

5 participants