namespace UnityEngine.Rendering.Universal
{
///
/// Contains the data for general renderer settings.
///
public class UniversalRenderingData : ContextItem
{
// Non-rendergraph path only. Do NOT use with rendergraph! (RG execution timeline breaks.)
// NOTE: internal for a ref return in legacy RenderingData.commandBuffer.
internal CommandBuffer m_CommandBuffer;
// Non-rendergraph path only. Do NOT use with rendergraph! (RG execution timeline breaks.)
internal CommandBuffer commandBuffer
{
get
{
if (m_CommandBuffer == null)
Debug.LogError("UniversalRenderingData.commandBuffer is null. RenderGraph does not support this property. Please use the command buffer provided by the RenderGraphContext.");
return m_CommandBuffer;
}
}
///
/// Returns culling results that exposes handles to visible objects, lights and probes.
/// You can use this to draw objects with ScriptableRenderContext.DrawRenderers
///
///
///
public CullingResults cullResults;
///
/// True if the pipeline supports dynamic batching.
/// This settings doesn't apply when drawing shadow casters. Dynamic batching is always disabled when drawing shadow casters.
///
public bool supportsDynamicBatching;
///
/// Holds per-object data that are requested when drawing
///
///
public PerObjectData perObjectData;
///
/// The Rendering mode used by the renderer in the current frame.
/// Note that this may sometimes be different from what is set in the Renderer asset,
/// for example when the hardware not capable of deferred rendering or when doing wireframe rendering.
///
public RenderingMode renderingMode { get; internal set; }
///
/// The layer mask set on the renderer to filter opaque objects.
///
public LayerMask opaqueLayerMask { get; internal set; }
///
/// The layer mask set on the renderer to filter transparent objects.
///
public LayerMask transparentLayerMask { get; internal set; }
///
public override void Reset()
{
m_CommandBuffer = default;
cullResults = default;
supportsDynamicBatching = default;
perObjectData = default;
renderingMode = default;
opaqueLayerMask = -1;
transparentLayerMask = -1;
}
}
}