/// <summary>
        /// Updates all the data
        /// </summary>
        public void Update()
        {
            if (_previousCascadesCount != QualitySettings.shadowCascades)
            {
                if (_directionalLightsShadowMapsCollector != null)
                {
                    _directionalLightsShadowMapsCollector.Resize(DirectionalLightsManager.ShadowMapSize.x, DirectionalLightsManager.ShadowMapSize.y);
                }

                if (_directionalLightsShadowDataCollector != null)
                {
                    _directionalLightsShadowDataCollector.ClearTexturesList(true);
                }

                if (OnCascadesCountChanged != null)
                {
                    OnCascadesCountChanged();
                }

                _previousCascadesCount = QualitySettings.shadowCascades;
            }

            GenerateLightsMaps();

            DirectionalLightsManager.Update();
        }
        /// <summary>
        /// Updates all the data
        /// </summary>
        public void Update()
        {
            bool waitForNextFrame = false;

            //int currentQualityLevelId = QualitySettings.GetQualityLevel();
            if (_directionalShadowsCasterCount > 0 && (_cascadesCount != QualitySettings.shadowCascades /* || _qualityLevelId != currentQualityLevelId*/))
            {
                ReleaseDirectionalRenderTexturesCollectors();

                _cascadesCount = QualitySettings.shadowCascades;
                //_qualityLevelId = currentQualityLevelId;

                if (OnShadowsSettingsChanged != null)
                {
                    OnShadowsSettingsChanged();
                }

                waitForNextFrame = true;
            }

            if (!waitForNextFrame)
            {
                GenerateLightsMaps();
            }

            DirectionalLightsManager.Update();
        }
 /// <summary>
 /// Releases the lights managers
 /// </summary>
 private void ReleaseLightsManagers()
 {
     if (_directionalLightsManager != null)
     {
         DirectionalLightsManager.Dispose();
     }
 }
Пример #4
0
        /// <summary>
        /// Updates all the data
        /// </summary>
        public void Update()
        {
            int currentQualityLevelId = QualitySettings.GetQualityLevel();

            if (_directionalShadowsCasterCount > 0 && (_cascadesCount != QualitySettings.shadowCascades || _qualityLevelId != currentQualityLevelId))
            {
                ReleaseDirectionalShadowsCollectors();

                _cascadesCount  = QualitySettings.shadowCascades;
                _qualityLevelId = currentQualityLevelId;

                if (OnShadowsSettingsChanged != null)
                {
                    OnShadowsSettingsChanged();
                }
            }

            GenerateLightsMaps();

            DirectionalLightsManager.Update();
        }