@@ -3223,15 +3223,23 @@ void UpdateRectangleLightBounds()
3223
3223
float halfWidth = m_ShapeWidth * 0.5f ;
3224
3224
float halfHeight = m_ShapeHeight * 0.5f ;
3225
3225
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 ) ;
3227
3235
}
3228
3236
3229
3237
void UpdateTubeLightBounds ( )
3230
3238
{
3231
3239
legacyLight . useShadowMatrixOverride = false ;
3232
3240
// TODO: Don't use bounding sphere overrides. Support this properly in Unity native instead.
3233
3241
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 ) ;
3235
3243
}
3236
3244
3237
3245
void UpdateBoxLightBounds ( )
@@ -3278,6 +3286,9 @@ void UpdateBounds()
3278
3286
case LightType . Rectangle :
3279
3287
UpdateRectangleLightBounds ( ) ;
3280
3288
break ;
3289
+ case LightType . Disc :
3290
+ UpdateDiscLightBounds ( ) ;
3291
+ break ;
3281
3292
case LightType . Tube :
3282
3293
UpdateTubeLightBounds ( ) ;
3283
3294
break ;
0 commit comments