Bez popisu
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.

UniversalRenderingData.cs 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. namespace UnityEngine.Rendering.Universal
  2. {
  3. /// <summary>
  4. /// Contains the data for general renderer settings.
  5. /// </summary>
  6. public class UniversalRenderingData : ContextItem
  7. {
  8. // Non-rendergraph path only. Do NOT use with rendergraph! (RG execution timeline breaks.)
  9. // NOTE: internal for a ref return in legacy RenderingData.commandBuffer.
  10. internal CommandBuffer m_CommandBuffer;
  11. // Non-rendergraph path only. Do NOT use with rendergraph! (RG execution timeline breaks.)
  12. internal CommandBuffer commandBuffer
  13. {
  14. get
  15. {
  16. if (m_CommandBuffer == null)
  17. Debug.LogError("UniversalRenderingData.commandBuffer is null. RenderGraph does not support this property. Please use the command buffer provided by the RenderGraphContext.");
  18. return m_CommandBuffer;
  19. }
  20. }
  21. /// <summary>
  22. /// Returns culling results that exposes handles to visible objects, lights and probes.
  23. /// You can use this to draw objects with <c>ScriptableRenderContext.DrawRenderers</c>
  24. /// <see cref="CullingResults"/>
  25. /// <seealso cref="ScriptableRenderContext"/>
  26. /// </summary>
  27. public CullingResults cullResults;
  28. /// <summary>
  29. /// True if the pipeline supports dynamic batching.
  30. /// This settings doesn't apply when drawing shadow casters. Dynamic batching is always disabled when drawing shadow casters.
  31. /// </summary>
  32. public bool supportsDynamicBatching;
  33. /// <summary>
  34. /// Holds per-object data that are requested when drawing
  35. /// <see cref="PerObjectData"/>
  36. /// </summary>
  37. public PerObjectData perObjectData;
  38. /// <summary>
  39. /// The Rendering mode used by the renderer in the current frame.
  40. /// Note that this may sometimes be different from what is set in the Renderer asset,
  41. /// for example when the hardware not capable of deferred rendering or when doing wireframe rendering.
  42. /// </summary>
  43. public RenderingMode renderingMode { get; internal set; }
  44. /// <summary>
  45. /// The layer mask set on the renderer to filter opaque objects.
  46. /// </summary>
  47. public LayerMask opaqueLayerMask { get; internal set; }
  48. /// <summary>
  49. /// The layer mask set on the renderer to filter transparent objects.
  50. /// </summary>
  51. public LayerMask transparentLayerMask { get; internal set; }
  52. /// <inheritdoc/>
  53. public override void Reset()
  54. {
  55. m_CommandBuffer = default;
  56. cullResults = default;
  57. supportsDynamicBatching = default;
  58. perObjectData = default;
  59. renderingMode = default;
  60. opaqueLayerMask = -1;
  61. transparentLayerMask = -1;
  62. }
  63. }
  64. }