Expand description
Unity meshes: vertex channels in interleaved streams (decoded through checked vertex layouts), or a compressed mesh (bit-packed quantised floats); an index buffer of 16- or 32-bit indices; submeshes.
Vertex data layout (Unity 5 and later): the channels name a stream, an offset in it, a format and a dimension; a
stream’s stride is the sum of its channels’ sizes, and the streams follow each other, each starting 16-byte
aligned. The bytes are in the mesh, or streamed from a resource file (m_StreamData).
A compressed mesh’s floats are PackedBitVectors: n items of bits bits each, little-endian bit order, each
start + item * (range / (2^bits - 1)) in f32; normals and tangents keep x and y, z is rebuilt from the unit
length with a stored sign; its indices are packed integers (m_Triangles).
Structs§
- Blend
- Bone influences per vertex, as a mesh stores them: vertex
v’s weights and bone slots areweights[starts[v]..starts[v + 1]]andbones[..], heaviest first. - Channel
- One decoded channel:
dimcomponents per vertex. - Mesh
Shapes - A mesh’s blend shapes as stored (
m_Shapes): per channel its frames in increasing weight (Unity’s weights run 0 to 100), per frame sparse deltas of the mesh’s vertices, applied to the mesh as stored before any skin. - Mesh
Skin - A mesh’s skin as stored, in Unity’s frame: the blend channels (
BlendWeightandBlendIndices: up to four influences a vertex, as Unity draws them at four or fewer), the full influences of a mesh that stores them (m_VariableBoneCountWeights, which Unity draws only at unlimited skin weights; the channels then hold its first four renormalised), and per bone the bind pose, the matrix taking the renderer’s local space to the bone’s at bind time. - Shape
Channel - One blend shape channel (
m_Shapes.channels): a name, the CRC-32 of it that an animation curve names it by, and its frames (framesof them fromfirst_frameinMeshShapes::frames). - Shape
Frame - One frame of a blend shape (
m_Shapes.shapes, itsfullWeightsentry): the weight it is at, its entries (countfromfirstinMeshShapes::vertices) and whether they carry normal and tangent deltas. - Shape
Vertex - A blend shape entry (
m_Shapes.vertices): the delta of vertexindexof the mesh, in Unity’s frame. - SubMesh
- A submesh: a run of the index buffer.
- Unity
Mesh Data - A mesh as stored, in Unity’s frame.
Constants§
- CHANNELS
- Unity’s shader channels, in the order of
m_Channels.
Type Aliases§
- Padded
Sets - A skin’s influences as sets of four per vertex (
[set][vertex]): the weights, the bone slots and the number of vertices cut to a limit (MeshSkin::padded).