Skip to content

Game.Rendering.BatchFlags

Assembly: Assembly-CSharp.dll
Namespace: Game.Rendering

Type: enum (with [Flags] attribute)

Base: System.Enum (underlying type: System.Int32)

Summary:
BatchFlags is a bitmask enum used by the rendering system to describe properties and feature-sets of a rendering "batch" (a group of geometry rendered together). Flags indicate whether a batch needs special handling such as motion vectors, skeletal animation (bones), emissive materials, LOD behavior, info-view overlays, and other rendering variants. Flags can be combined using bitwise operations to represent multiple capabilities at once. Some member meanings are implementation-specific and may be used by shaders, material variants or culling/submit logic.


Fields

  • MotionVectors = 1
    Indicates the batch participates in motion-vector rendering (used for motion blur / temporal reprojection).

  • Animated = 2
    Marks that the batch uses vertex animation / animation data affecting vertices (distinct from skeletal bones).

  • Bones = 4
    Indicates skeletal skinning is used (the batch uses bone matrices / skinning).

  • Emissive = 8
    Batch has emissive material channels and should be treated as self-illuminated by relevant passes.

  • ColorMask = 0x10
    Enables color-masking behavior (e.g., per-instance color tinting or selective color write). Exact usage may vary.

  • Outline = 0x20
    Batch should participate in outline rendering (edge/selection highlight passes).

  • InfoviewColor = 0x40
    Used for info-view overlays where batches are drawn with special color coding (e.g., zoning, traffic).

  • Lod = 0x80
    Batch supports level-of-detail (LOD) selection.

  • Node = 0x100
    Likely indicates node-specific rendering behavior (used with network nodes/props). Usage is implementation-dependent.

  • Roundabout = 0x200
    Special-case flag possibly used to identify roundabout-related geometry or rendering path.

  • Extended1 = 0x400
    Reserved/extension flag for additional behavior (meaning depends on engine usage).

  • Extended2 = 0x800
    Reserved/extension flag for additional behavior.

  • Extended3 = 0x1000
    Reserved/extension flag for additional behavior.

  • LodFade = 0x2000
    Enables smooth LOD fading (cross-fading between LOD levels).

  • InfoviewFlow = 0x4000
    Used by flow/overlay visualizations in info views (e.g., traffic flow overlays).

  • Hanging = 0x8000
    Indicates hanging geometry (props/objects attached in a hanging state) or special culling/placement.

  • BlendWeights = 0x10000
    Uses blend weights (vertex blending) — often relevant for complex skinning/morph targets.

  • SurfaceState = 0x20000
    Encodes or selects a surface state variant (e.g., wet/dry, terrain surface variations).

  • Base = 0x40000
    Base geometry flag — typically denotes the core/base pass or default variant for a batch.

Properties

  • (None — this is a plain enum; use bitwise operations to query/modify flags)

Constructors

  • (None explicit — enum values are constant; default value is 0)

Methods

  • (None — use System.Enum helpers or bitwise operators for checks/manipulation)

Usage Example

// Combine flags for a skinned, emissive mesh that participates in LOD and motion vectors
BatchFlags flags = BatchFlags.Bones | BatchFlags.Emissive | BatchFlags.Lod | BatchFlags.MotionVectors;

// Test for a single flag
bool usesBones = (flags & BatchFlags.Bones) != 0;

// Remove a flag
flags &= ~BatchFlags.Emissive;

// Add a flag
flags |= BatchFlags.LodFade;

// Alternative: use HasFlag (slower boxed path)
if (flags.HasFlag(BatchFlags.MotionVectors)) {
    // enable motion-vector pass for this batch
}

Notes: - Because the enum has the [Flags] attribute, combine values with | and test with &. Prefer bitwise checks for performance-sensitive rendering code. - Many member meanings are specific to the game's renderer and shader pipeline; treat Extended1/2/3 and some others as engine-specific extension flags.