Skip to content

Commit 8a3a0bf

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [6000.0] [UUM-135640][6000.6][URP 2D] Fix shadow caster 2d culling
1 parent f098e1d commit 8a3a0bf

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
@@ -274,9 +274,9 @@ internal bool IsLit(Light2D light)
274274
{
275275
// Oddly adding and subtracting vectors is expensive here because of the new structures created...
276276
Vector3 deltaPos;
277-
deltaPos.x = light.m_CachedPosition.x - boundingSphere.position.x;
278-
deltaPos.y = light.m_CachedPosition.y - boundingSphere.position.y;
279-
deltaPos.z = light.m_CachedPosition.z - boundingSphere.position.z;
277+
deltaPos.x = light.boundingSphere.position.x - boundingSphere.position.x;
278+
deltaPos.y = light.boundingSphere.position.y - boundingSphere.position.y;
279+
deltaPos.z = light.boundingSphere.position.z - boundingSphere.position.z;
280280

281281
float distanceSq = Vector3.SqrMagnitude(deltaPos);
282282

0 commit comments

Comments
 (0)