Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

UniversalShadowData.cs 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. using System;
  2. using System.Collections.Generic;
  3. using Unity.Collections;
  4. namespace UnityEngine.Rendering.Universal
  5. {
  6. /// <summary>
  7. /// Container class for various data used for shadows in URP.
  8. /// </summary>
  9. public class UniversalShadowData : ContextItem
  10. {
  11. /// <summary>
  12. /// True if main light shadows are enabled.
  13. /// </summary>
  14. public bool supportsMainLightShadows;
  15. /// <summary>
  16. /// True if additional lights shadows are enabled in the URP Asset
  17. /// </summary>
  18. internal bool mainLightShadowsEnabled;
  19. /// <summary>
  20. /// The width of the main light shadow map.
  21. /// </summary>
  22. public int mainLightShadowmapWidth;
  23. /// <summary>
  24. /// The height of the main light shadow map.
  25. /// </summary>
  26. public int mainLightShadowmapHeight;
  27. /// <summary>
  28. /// The number of shadow cascades.
  29. /// </summary>
  30. public int mainLightShadowCascadesCount;
  31. /// <summary>
  32. /// The split between cascades.
  33. /// </summary>
  34. public Vector3 mainLightShadowCascadesSplit;
  35. /// <summary>
  36. /// Main light last cascade shadow fade border.
  37. /// Value represents the width of shadow fade that ranges from 0 to 1.
  38. /// Where value 0 is used for no shadow fade.
  39. /// </summary>
  40. public float mainLightShadowCascadeBorder;
  41. /// <summary>
  42. /// True if additional lights shadows are enabled.
  43. /// </summary>
  44. public bool supportsAdditionalLightShadows;
  45. /// <summary>
  46. /// True if additional lights shadows are enabled in the URP Asset
  47. /// </summary>
  48. internal bool additionalLightShadowsEnabled;
  49. /// <summary>
  50. /// The width of the additional light shadow map.
  51. /// </summary>
  52. public int additionalLightsShadowmapWidth;
  53. /// <summary>
  54. /// The height of the additional light shadow map.
  55. /// </summary>
  56. public int additionalLightsShadowmapHeight;
  57. /// <summary>
  58. /// True if soft shadows are enabled.
  59. /// </summary>
  60. public bool supportsSoftShadows;
  61. /// <summary>
  62. /// The number of bits used.
  63. /// </summary>
  64. public int shadowmapDepthBufferBits;
  65. /// <summary>
  66. /// A list of shadow bias.
  67. /// </summary>
  68. public List<Vector4> bias;
  69. /// <summary>
  70. /// A list of resolution for the shadow maps.
  71. /// </summary>
  72. public List<int> resolution;
  73. internal bool isKeywordAdditionalLightShadowsEnabled;
  74. internal bool isKeywordSoftShadowsEnabled;
  75. internal int mainLightShadowResolution;
  76. internal int mainLightRenderTargetWidth;
  77. internal int mainLightRenderTargetHeight;
  78. internal NativeArray<URPLightShadowCullingInfos> visibleLightsShadowCullingInfos;
  79. internal AdditionalLightsShadowAtlasLayout shadowAtlasLayout;
  80. /// <inheritdoc/>
  81. public override void Reset()
  82. {
  83. supportsMainLightShadows = false;
  84. mainLightShadowmapWidth = 0;
  85. mainLightShadowmapHeight = 0;
  86. mainLightShadowCascadesCount = 0;
  87. mainLightShadowCascadesSplit = Vector3.zero;
  88. mainLightShadowCascadeBorder = 0.0f;
  89. supportsAdditionalLightShadows = false;
  90. additionalLightsShadowmapWidth = 0;
  91. additionalLightsShadowmapHeight = 0;
  92. supportsSoftShadows = false;
  93. shadowmapDepthBufferBits = 0;
  94. bias?.Clear();
  95. resolution?.Clear();
  96. isKeywordAdditionalLightShadowsEnabled = false;
  97. isKeywordSoftShadowsEnabled = false;
  98. mainLightShadowResolution = 0;
  99. mainLightRenderTargetWidth = 0;
  100. mainLightRenderTargetHeight = 0;
  101. visibleLightsShadowCullingInfos = default;
  102. shadowAtlasLayout = default;
  103. }
  104. }
  105. }