Ingen beskrivning
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AdaptivePerformanceRenderSettings.cs 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace UnityEngine.AdaptivePerformance
  5. {
  6. /// <summary>
  7. /// This class is used to store changes to a number of rendering quality settings that are applied when using
  8. /// the Universal Render Pipeline.
  9. /// </summary>
  10. public static class AdaptivePerformanceRenderSettings
  11. {
  12. private static float s_MaxShadowDistanceMultiplier = 1;
  13. private static float s_ShadowResolutionMultiplier = 1;
  14. private static float s_RenderScaleMultiplier = 1;
  15. private static float s_DecalsMaxDistance = 1000;
  16. /// <summary>
  17. /// Amount to multiply the main lights shadowmap resolution. Values are clamped between 0 and 1.
  18. /// </summary>
  19. public static float MainLightShadowmapResolutionMultiplier
  20. {
  21. get { return s_ShadowResolutionMultiplier; }
  22. set { s_ShadowResolutionMultiplier = Mathf.Clamp01(value); }
  23. }
  24. /// <summary>
  25. /// Adjust the drawdistance for decals.
  26. /// </summary>
  27. public static float DecalsDrawDistance
  28. {
  29. get { return s_DecalsMaxDistance; }
  30. set { s_DecalsMaxDistance = value; }
  31. }
  32. /// <summary>
  33. /// Adjust the number of shadow cascades for the main camera in the scene.
  34. /// </summary>
  35. public static int MainLightShadowCascadesCountBias
  36. {
  37. get;
  38. set;
  39. }
  40. /// <summary>
  41. /// Adjust the quality setting of shadows.
  42. /// </summary>
  43. public static int ShadowQualityBias
  44. {
  45. get;
  46. set;
  47. }
  48. /// <summary>
  49. /// Adjust the size of lookup tables that are used for color grading.
  50. /// </summary>
  51. public static float LutBias
  52. {
  53. get;
  54. set;
  55. }
  56. /// <summary>
  57. /// Adjust how far in the distance shadows will be rendered. Values are clamped between 0 and 1.
  58. /// </summary>
  59. public static float MaxShadowDistanceMultiplier
  60. {
  61. get { return s_MaxShadowDistanceMultiplier; }
  62. set { s_MaxShadowDistanceMultiplier = Mathf.Clamp01(value); }
  63. }
  64. /// <summary>
  65. /// Lower the resolution of the main camera to reduce fillrate and GPU load.
  66. /// </summary>
  67. public static float RenderScaleMultiplier
  68. {
  69. get { return s_RenderScaleMultiplier; }
  70. set { s_RenderScaleMultiplier = Mathf.Clamp01(value); }
  71. }
  72. /// <summary>
  73. /// Adjust the quality of MSAA.
  74. /// </summary>
  75. public static int AntiAliasingQualityBias
  76. {
  77. get;
  78. set;
  79. }
  80. /// <summary>
  81. /// Whether dynamic batching should be used when rendering multiple objects that share the same material.
  82. /// Useful on hardware that does not support instancing.
  83. /// </summary>
  84. public static bool SkipDynamicBatching
  85. {
  86. get;
  87. set;
  88. }
  89. /// <summary>
  90. /// Whether depth-based sorting should be enabled.
  91. /// When enabled, there is a higher load on the CPU but less rendering overdraw.
  92. /// When disabled, there is less CPU pressure but more overdraw.
  93. /// </summary>
  94. public static bool SkipFrontToBackSorting
  95. {
  96. get;
  97. set;
  98. }
  99. /// <summary>
  100. /// Whether transparent objects should be rendered
  101. /// When enabled, there is less rendering overdraw, but entire objects can disappear.
  102. /// </summary>
  103. public static bool SkipTransparentObjects
  104. {
  105. get;
  106. set;
  107. }
  108. }
  109. }