Skip to content

Game.Rendering.MetaBufferData

Assembly: Assembly-CSharp (game)
Namespace: Game.Rendering

Type: struct

Base: System.ValueType

Summary:
MetaBufferData is a small value-type container that holds metadata used by the renderer for a mesh/buffer element. It contains integer counts/offsets for bone and shape data and several blend weight/color structures used for shape/texture/overlay/mask blending. This struct is typically used to describe how to interpret GPU/CPU buffers for skinned or blended meshes (morph targets, texture blends, overlays, etc.).


Fields

  • public int m_BoneOffset
    Index/offset into a bone index/buffer where this mesh's bone indices start. Used by skinning to find the bone data for this sub-mesh.

  • public int m_BoneCount
    Number of bones that affect this mesh/submesh. Used to know how many bone matrices or indices to read.

  • public int m_ShapeCount
    Number of vertex shapes/morph targets associated with this mesh. Used for shape-blending (morph targets).

  • public BlendWeights m_ShapeWeights
    Blend weights for the mesh shapes (morph target weights). Type BlendWeights is a small value type representing a set of blend factors.

  • public BlendWeights m_TextureWeights
    Blend weights used for texture blending layers.

  • public BlendWeights m_OverlayWeights
    Blend weights for overlay layers (additional blended layers over base material).

  • public BlendWeights m_MaskWeights
    Blend weights for masks (used to mask blends or influence areas).

  • public BlendColors m_OverlayColors1
    Colors associated with overlays (first color set). BlendColors is a small value type representing color blend parameters.

Properties

  • This struct defines no properties; it exposes its data as public fields.

Constructors

  • public MetaBufferData()
    Structs have an implicit parameterless constructor that initializes value-type fields to their default values (0 for ints, default(BlendWeights)/default(BlendColors) for the blend structs). You can also initialize using an object initializer.

Methods

  • This struct defines no methods.

Usage Example

// Create and initialize MetaBufferData for a sub-mesh
var meta = new MetaBufferData {
    m_BoneOffset = 128,      // offset into bone index buffer
    m_BoneCount = 24,        // number of bones influencing this mesh
    m_ShapeCount = 3,        // number of morph targets
    m_ShapeWeights = new BlendWeights(),   // set up as appropriate
    m_TextureWeights = new BlendWeights(),
    m_OverlayWeights = new BlendWeights(),
    m_MaskWeights = new BlendWeights(),
    m_OverlayColors1 = new BlendColors()   // set overlay colors as needed
};

// Note: BlendWeights and BlendColors are custom structs; fill them according to their API.
// If you need to pass MetaBufferData to native code or expect a specific memory layout,
// consider decorating with [StructLayout(LayoutKind.Sequential)] and ensure the layout/packing matches the native side.

Additional notes: - MetaBufferData is mutable (public fields); be careful with concurrent access from multiple threads. - If you plan to marshal this struct to native code or GPU buffers, verify the exact memory layout/padding of BlendWeights/BlendColors and add explicit layout attributes if necessary.