| | 1 | | using System; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | namespace DCL.Rendering |
| | 5 | | { |
| | 6 | | /// <summary> |
| | 7 | | /// This class contains the settings CullingController. Mainly used by the quality settings panel. |
| | 8 | | /// </summary> |
| | 9 | | [System.Serializable] |
| | 10 | | public class CullingControllerSettings |
| | 11 | | { |
| | 12 | | [NonSerialized] |
| 79 | 13 | | public float maxTimeBudget = 4 / 1000f; |
| | 14 | |
|
| 79 | 15 | | public bool enableObjectCulling = true; |
| 79 | 16 | | public bool enableShadowCulling = true; |
| | 17 | | public bool enableAnimationCulling = false; |
| | 18 | |
|
| 79 | 19 | | public float enableAnimationCullingDistance = 7.5f; |
| | 20 | |
|
| 79 | 21 | | public int ignoredLayersMask = LayerMask.GetMask("Tutorial", "CharacterPreview", "ViewportCullingIgnored"); |
| | 22 | |
|
| 79 | 23 | | public CullingControllerProfile rendererProfile = |
| | 24 | | new CullingControllerProfile |
| | 25 | | { |
| | 26 | | visibleDistanceThreshold = 30, |
| | 27 | | shadowDistanceThreshold = 20, |
| | 28 | | emissiveSizeThreshold = 2.5f, |
| | 29 | | opaqueSizeThreshold = 6, |
| | 30 | | shadowRendererSizeThreshold = 10, |
| | 31 | | shadowMapProjectionSizeThreshold = 4, |
| | 32 | | maxShadowDistanceForAvatars = 20, |
| | 33 | | }; |
| | 34 | |
|
| 79 | 35 | | public CullingControllerProfile skinnedRendererProfile = |
| | 36 | | new CullingControllerProfile |
| | 37 | | { |
| | 38 | | visibleDistanceThreshold = 50, |
| | 39 | | shadowDistanceThreshold = 40, |
| | 40 | | emissiveSizeThreshold = 2.5f, |
| | 41 | | opaqueSizeThreshold = 6, |
| | 42 | | shadowRendererSizeThreshold = 5, |
| | 43 | | shadowMapProjectionSizeThreshold = 4, |
| | 44 | | maxShadowDistanceForAvatars = 20, |
| | 45 | | }; |
| | 46 | |
|
| | 47 | | /// <summary> |
| | 48 | | /// Returns a clone of this object. The profiles are also cloned, making this return a deep clone. |
| | 49 | | /// </summary> |
| | 50 | | /// <returns>The deep clone.</returns> |
| | 51 | | public CullingControllerSettings Clone() |
| | 52 | | { |
| 7 | 53 | | var clone = this.MemberwiseClone() as CullingControllerSettings; |
| 7 | 54 | | clone.rendererProfile = rendererProfile.Clone(); |
| 7 | 55 | | clone.skinnedRendererProfile = skinnedRendererProfile.Clone(); |
| 7 | 56 | | return clone; |
| | 57 | | } |
| | 58 | | } |
| | 59 | | } |