void AddBounds(CachedShadowMapLight a_light)
        {
            var bounding_sphere = BoundsUtility.ComputeLightBoundingSphere(a_light: a_light);

            if (this._LightBoundingSpheres.ContainsKey(key: a_light.LightComponent))
            {
                this._LightBoundingSpheres[key : a_light.LightComponent] = bounding_sphere;
            }
            else
            {
                this._LightBoundingSpheres.Add(key: a_light.LightComponent, value: bounding_sphere);
            }

            var light_bounds = BoundsUtility.ComputeLightBounds(light: a_light);

            if (this._LightBounds.ContainsKey(key: a_light.LightComponent))
            {
                this._LightBounds[key : a_light.LightComponent] = light_bounds;
            }
            else
            {
                this._LightBounds.Add(key: a_light.LightComponent, value: light_bounds);
            }

            this.ReceiverCamera?.RefreshCullingGroup();
        }
Example #2
0
        void OnDrawGizmosSelected()
        {
            var sphere = BoundsUtility.ComputeLightBoundingSphere(a_light: this);

            Gizmos.color = Color.yellow;
            Gizmos.DrawWireSphere(center: sphere.position, radius: sphere.radius);
        }