Ei kuvausta
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.

UniversalLightData.cs 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using Unity.Collections;
  3. namespace UnityEngine.Rendering.Universal
  4. {
  5. /// <summary>
  6. /// Class that holds settings related to lights.
  7. /// </summary>
  8. public class UniversalLightData : ContextItem
  9. {
  10. /// <summary>
  11. /// Holds the main light index from the <c>VisibleLight</c> list returned by culling. If there's no main light in the scene, <c>mainLightIndex</c> is set to -1.
  12. /// The main light is the directional light assigned as Sun source in light settings or the brightest directional light.
  13. /// <seealso cref="CullingResults"/>
  14. /// </summary>
  15. public int mainLightIndex;
  16. /// <summary>
  17. /// The number of additional lights visible by the camera.
  18. /// </summary>
  19. public int additionalLightsCount;
  20. /// <summary>
  21. /// Maximum amount of lights that can be shaded per-object. This value only affects forward rendering.
  22. /// </summary>
  23. public int maxPerObjectAdditionalLightsCount;
  24. /// <summary>
  25. /// List of visible lights returned by culling.
  26. /// </summary>
  27. public NativeArray<VisibleLight> visibleLights;
  28. /// <summary>
  29. /// True if additional lights should be shaded in vertex shader, otherwise additional lights will be shaded per pixel.
  30. /// </summary>
  31. public bool shadeAdditionalLightsPerVertex;
  32. /// <summary>
  33. /// True if mixed lighting is supported.
  34. /// </summary>
  35. public bool supportsMixedLighting;
  36. /// <summary>
  37. /// True if box projection is enabled for reflection probes.
  38. /// </summary>
  39. public bool reflectionProbeBoxProjection;
  40. /// <summary>
  41. /// True if blending is enabled for reflection probes.
  42. /// </summary>
  43. public bool reflectionProbeBlending;
  44. /// <summary>
  45. /// True if light layers are enabled.
  46. /// </summary>
  47. public bool supportsLightLayers;
  48. /// <summary>
  49. /// True if additional lights enabled.
  50. /// </summary>
  51. public bool supportsAdditionalLights;
  52. /// <inheritdoc/>
  53. public override void Reset()
  54. {
  55. mainLightIndex = -1;
  56. additionalLightsCount = 0;
  57. maxPerObjectAdditionalLightsCount = 0;
  58. visibleLights = default;
  59. shadeAdditionalLightsPerVertex = false;
  60. supportsMixedLighting = false;
  61. reflectionProbeBoxProjection = false;
  62. reflectionProbeBlending = false;
  63. supportsLightLayers = false;
  64. supportsAdditionalLights = false;
  65. }
  66. }
  67. }