// Perfect Culling (C) 2021 Patrick König // using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Koenigz.PerfectCulling { public static class PerfectCullingConstants { /// /// The maximum amount of renderers supported. /// /// NOTICE: /// Changing this value might not be sufficient to support additional renderers. In many places ushort is used to save memory. /// Furthermore you should rather consider using overlapping volumes and/or reducing the number of individual renderers! /// public const int MaxRenderers = ushort.MaxValue; /// /// How many positions are sampled before they are read back from the GPU. /// /// WARNING: /// Increasing this number can speed up the baking process but could result in the GPU and/or CPU to run out of memory. /// On the other side decreasing this number could help if you are already hitting memory limits. /// /// This is ignored when using the native renderer. /// /// public const int SampleBatchCount = 2048; /// /// The baking camera only renders this layers. /// However any renderer that is not supposed to be in the snapshot is automatically disabled as well. /// Concluding that this should "just work" and doesn't need adjustments. /// public const int CamBakeLayer = 30; /// /// Allows to set Renderers to only shadow casting instead of disabling them completely. /// public const PerfectCullingRenderToggleMode ToggleRenderMode = PerfectCullingRenderToggleMode.ToggleForceRenderingOff; /// /// Sanity checks the data. Comes with a bit of overhead but you can be sure the data makes sense. /// public const bool SafetyChecks = true; /// /// Supported Renderer types /// public static readonly HashSet SupportedRendererTypes = new HashSet() { typeof(MeshRenderer), typeof(SkinnedMeshRenderer) }; /// /// Internally used. Don't change. /// public static Color ClearColor = Color.black; /// /// Scene reload is necessary for correct function but can be useful to disable it for debugging purposes. /// public static bool AllowSceneReload = true; /// /// Path for multi scene temp scene /// public static readonly string MultiSceneTempPath = @"Assets/PerfectCulling_Temp.unity"; /// /// Controls opaqueness of volume visualization inside the Editor /// public const float VolumeInsideAlpha = 0.05f; /// /// Limits the search range for finding non-empty cells when EmptyCellCullBehaviour is set to FindClosestNonEmptyCell. /// This is done for performance reasons because we evaluate this at run-time and need to scan all three dimensions. /// * Range of 3 requires 3 * 3 * 3 = 27 iterations. /// * Range of 4 requires 4 * 4 * 4 = 64 iterations. /// public const int MaxNonEmptyCellSearchRange = 3; /// /// Allows to report invalid renderer references. /// public const bool ReportInvalidRenderers = true; /// /// Disables dialogs that require user confirmation. /// Could be useful for automated processes. /// public const bool DisableConfirmationDialogs = false; } }