Skip to content

Commit c64fa8b

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [6000.5] [UUM-135640][6000.6][URP 2D] Fix shadow caster 2d culling
1 parent 2958b11 commit c64fa8b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowCaster2D.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,9 @@ internal bool IsLit(Light2D light)
279279
{
280280
// Oddly adding and subtracting vectors is expensive here because of the new structures created...
281281
Vector3 deltaPos;
282-
deltaPos.x = light.m_CachedPosition.x - boundingSphere.position.x;
283-
deltaPos.y = light.m_CachedPosition.y - boundingSphere.position.y;
284-
deltaPos.z = light.m_CachedPosition.z - boundingSphere.position.z;
282+
deltaPos.x = light.boundingSphere.position.x - boundingSphere.position.x;
283+
deltaPos.y = light.boundingSphere.position.y - boundingSphere.position.y;
284+
deltaPos.z = light.boundingSphere.position.z - boundingSphere.position.z;
285285

286286
float distanceSq = Vector3.SqrMagnitude(deltaPos);
287287

0 commit comments

Comments
 (0)