@@ -3223,15 +3223,23 @@ void UpdateRectangleLightBounds()
32233223 float halfWidth = m_ShapeWidth * 0.5f ;
32243224 float halfHeight = m_ShapeHeight * 0.5f ;
32253225 float diag = Mathf . Sqrt ( halfWidth * halfWidth + halfHeight * halfHeight ) ;
3226- legacyLight . boundingSphereOverride = new Vector4 ( 0.0f , 0.0f , 0.0f , Mathf . Max ( range , diag ) ) ;
3226+ legacyLight . boundingSphereOverride = new Vector4 ( 0.0f , 0.0f , 0.0f , range + diag ) ;
3227+ }
3228+
3229+ void UpdateDiscLightBounds ( )
3230+ {
3231+ legacyLight . useShadowMatrixOverride = false ;
3232+ // TODO: Don't use bounding sphere overrides. Support this properly in Unity native instead.
3233+ legacyLight . useBoundingSphereOverride = true ;
3234+ legacyLight . boundingSphereOverride = new Vector4 ( 0.0f , 0.0f , 0.0f , range + m_ShapeWidth ) ;
32273235 }
32283236
32293237 void UpdateTubeLightBounds ( )
32303238 {
32313239 legacyLight . useShadowMatrixOverride = false ;
32323240 // TODO: Don't use bounding sphere overrides. Support this properly in Unity native instead.
32333241 legacyLight . useBoundingSphereOverride = true ;
3234- legacyLight . boundingSphereOverride = new Vector4 ( 0.0f , 0.0f , 0.0f , Mathf . Max ( range , m_ShapeWidth * 0.5f ) ) ;
3242+ legacyLight . boundingSphereOverride = new Vector4 ( 0.0f , 0.0f , 0.0f , range + m_ShapeWidth * 0.5f ) ;
32353243 }
32363244
32373245 void UpdateBoxLightBounds ( )
@@ -3278,6 +3286,9 @@ void UpdateBounds()
32783286 case LightType . Rectangle :
32793287 UpdateRectangleLightBounds ( ) ;
32803288 break ;
3289+ case LightType . Disc :
3290+ UpdateDiscLightBounds ( ) ;
3291+ break ;
32813292 case LightType . Tube :
32823293 UpdateTubeLightBounds ( ) ;
32833294 break ;
0 commit comments