Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


BatchCullingContext

Culling context for a batch.
Read time 1 minuteLast updated 5 days ago

Definition

public struct BatchCullingContext

Remarks

Specifies the data required to perform culling. Additional Resources: BatchRendererGroup.OnPerformCulling.

Fields

Value

Description

cullingFlagsAdditional culling information for the current context.
cullingLayerMaskThe
cullingLayerMask
value of the object from which the culling is invoked. The draw command is discarded by the internal culling if the expression
(1 << layer) & cullingLayerMask
is false. Using this field is optional, use it for performance or other optimization purposes.
cullingPlanesPlanes to cull against.
cullingSplitsThe array of CullingSplit structs.
localToWorldMatrixLocal to world matrix.
lodParametersAdditional Resources: LODParameters.
projectionTypeThe projection of the view from which the culling is invoked. Usage example: take different culling paths for orthographic vs perspective views.
receiverPlaneCountThe number of receiver planes.
receiverPlaneOffsetThe index of the first receiver plane in the BatchCullingContext.cullingPlanes array.
sceneCullingMaskUse this bit mask to discard the draw commands in a particular context. A draw command is not discarded if the expression
(1 << layer) & sceneCullingMask
is true. This field is typically used when rendering Editor previews.
splitExclusionMaskA bitmask that represents the BatchCullingContext.cullingSplits Unity ignores in a BatchDrawCommand struct.
viewIDThe ID of the object from which the culling is invoked. Usage example: store culling-related data for each object.
viewTypeThe type of the view from which the culling is invoked. Usage examples: skip culling, take different culling paths depending on the view type, etc.