using System; namespace UnityEngine.Rendering.HighDefinition { /// /// Debug mode for texture mipmap streaming. /// // Keep in sync with DebugViewEnums.cs in URP's ShaderLibrary/Debug/DebugViewEnums.cs [GenerateHLSL] public enum DebugMipMapMode { /// No mipmap debug. None, /// Display savings and shortage due to streaming. MipStreamingPerformance, /// Display the streaming status of materials and textures. MipStreamingStatus, /// Highlight recently streamed data. MipStreamingActivity, /// Display streaming priorities as set up when importing. MipStreamingPriority, /// Display the amount of uploaded mip levels. MipCount, /// Visualize the pixel density for the highest-resolution uploaded mip level from the camera's point-of-view. MipRatio, } /// /// Aggregation mode for texture mipmap streaming debugging information. /// // Keep in sync with DebugMipMapStatusMode in URP's ShaderLibrary/Debug/DebugViewEnums.cs [GenerateHLSL] public enum DebugMipMapStatusMode { /// Show debug information aggregated per material. Material, /// Show debug information for the selected texture slot. Texture, } /// /// Terrain layer for texture mipmap streaming debugging. /// [GenerateHLSL] public enum DebugMipMapModeTerrainTexture { /// Control texture debug. Control, /// Layer 0 diffuse texture debug. [InspectorName("Layer 0 - Diffuse")] Layer0, /// Layer 1 diffuse texture debug. [InspectorName("Layer 1 - Diffuse")] Layer1, /// Layer 2 diffuse texture debug. [InspectorName("Layer 2 - Diffuse")] Layer2, /// Layer 3 diffuse texture debug. [InspectorName("Layer 3 - Diffuse")] Layer3, /// Layer 4 diffuse texture debug. [InspectorName("Layer 4 - Diffuse")] Layer4, /// Layer 5 diffuse texture debug. [InspectorName("Layer 5 - Diffuse")] Layer5, /// Layer 6 diffuse texture debug. [InspectorName("Layer 6 - Diffuse")] Layer6, /// Layer 7 diffuse texture debug. [InspectorName("Layer 7 - Diffuse")] Layer7 } /// /// Texture mipmap streaming debug settings. /// [Serializable] public class MipMapDebugSettings { /// Debug mode to visualize. public DebugMipMapMode debugMipMapMode = DebugMipMapMode.None; /// The material texture slot for which debug information is shown. public int materialTextureSlot = 0; /// The terrain layer for which debug information is shown on terrains. public DebugMipMapModeTerrainTexture terrainTexture = DebugMipMapModeTerrainTexture.Control; /// Combine the information over all slots per material. public bool showInfoForAllSlots = true; /// /// Whether combining information over texture slots is possible for the current debug mode. /// /// True if combining information over texture slots is possible for the current debug mode. public bool CanAggregateData() { return debugMipMapMode == DebugMipMapMode.MipStreamingStatus || debugMipMapMode == DebugMipMapMode.MipStreamingActivity; } /// Opacity of texture mipmap streaming debug colors. public float mipmapOpacity = 1.0f; /// How long a texture should be shown as "recently updated". public float recentlyUpdatedCooldown = 3.0f; /// Show detailed status codes for the Mipmap Streaming Status debug view. public bool showStatusCode = false; /// Aggregation mode for showing debug information per texture or aggregated for each material. public DebugMipMapStatusMode statusMode = DebugMipMapStatusMode.Material; /// /// Returns true if any texture mipmap streaming debug view is enabled. /// /// True if any texture mipmap streaming debug view is enabled. public bool IsDebugDisplayEnabled() { return debugMipMapMode != DebugMipMapMode.None; } } }