Vixen
02b45cc4
csharp
public record class MeshData

The geometry of one mesh, as it came out of an authoring tool.

Read the guide page for this →

Remarks

The CPU side of MeshDraw. That struct holds buffer handles and a range, because it is read once per object in a frame; this holds arrays, because it is read once per build by something deciding what those buffers should contain.

Parallel arrays, and typed ones. A vertex is not a struct here, because the layout is a compile-time decision — which attributes are present, in what order, at what precision, interleaved or not — and doc 08 puts that in ModelCompiler where the whole model is in hand. Separate arrays let a compiler drop an attribute nothing samples without rewriting the ones it keeps.

An attribute the file did not have is an empty array rather than a null or a defaulted one. Empty says "this mesh has no tangents"; an array of zeros says "this mesh has tangents and they are all degenerate", and a compiler cannot tell the second from a bug in the first.

Fields and properties (20)

  • public string Name

    What the mesh is called. Its sub-asset name, and part of its address.

  • public Vector3[] Positions

    One position per vertex.

  • public Vector3[] Normals

    One normal per vertex, or empty.

  • public Vector4[] Tangents

    One tangent per vertex, or empty. W is the bitangent's sign.

  • public Vector2[] TexCoords

    One texture coordinate per vertex, or empty.

  • public Vector2[] TexCoords1

    A second texture coordinate per vertex, or empty.

  • public Vector4[] Colors

    One colour per vertex, or empty. Linear, straight alpha.

  • public int[] Indices

    Three indices per triangle.

  • public int[] BoneIndices

    Four joint indices per vertex, or empty if the mesh is not skinned.

  • public float[] BoneWeights

    Four weights per vertex, summing to one, or empty.

  • public int MaterialIndex

    Which of the model's materials this is drawn with.

  • public BoundingBox Bounds

    Everything the mesh occupies, in the model's space.

  • public AssetReference Clusters

    This mesh's cluster hierarchy and page records, or null if it has none.

  • public AssetReference ClusterPages

    Where this mesh's page blob is, or null if it has no clusters.

  • public bool IsClustered

    Whether it was built with a cluster hierarchy.

  • public int VertexCount

    How many vertices it has.

  • public int TriangleCount

    How many triangles it has.

  • public bool IsSkinned

    Whether it carries skinning weights.

  • public bool HasColors

    Whether it carries per-vertex colours.

  • public bool HasTexCoords1

    Whether it carries a second texture coordinate set.

Used by (51, showing 40)

  • AssetMeshSourceVixen.Engine.Renderer
  • AssetVirtualGeometrySourceVixen.Engine.Renderer
  • BuilderVixen.Rendering
  • DeferredMeshSourceVixen.Engine.Renderer.Tests
  • EditorGizmoFacingDeviceTestsVixen.Graphics.Golden.Tests
  • EntryVixen.Engine.Renderer
  • EveryMeshVixen.Rendering.Tests
  • GeometryResidencyVixen.Rendering
  • IMeshSourceVixen.Rendering
  • MeshExtractionSystemVixen.Rendering
  • MeshExtractionTestsVixen.Rendering.Tests
  • MeshInstanceRendererVixen.Rendering
  • MeshInstanceRendererTestsVixen.Rendering.Tests
  • MeshPrimitivesVixen.Rendering
  • MeshPrimitivesTestsVixen.Rendering.Tests
  • MeshRenderableVixen.Rendering
  • ModelDataTestsVixen.Rendering.Tests
  • OneMeshVixen.Rendering.Tests
  • SurfaceGeometryVixen.Rendering
  • SurfaceGeometryTestsVixen.Rendering.Tests
  • TypeRegistrationVixen.Rendering
  • Vixen_Rendering_MeshDataSerializerVixen.Rendering
  • WorldRendererTestsVixen.Engine.Renderer.Tests
  • BlockoutBooleanTestsVixen.Editor.Blockout.Tests
  • BlockoutHandoffVixen.Editor.Blockout
  • BlockoutSurfaceTestsVixen.Editor.Blockout.Tests
  • EditMeshSceneTestsVixen.Editor.SceneView.Tests
  • EditMeshesVixen.Editor.SceneView
  • GizmoGeometryVixen.Editor.SceneView
  • ImportedGeometryLoadsTestsVixen.Editor.Assets.Tests
  • MeshElementsVixen.Editor.SceneView
  • MeshExportVixen.Editor.SceneView
  • MeshesVixen.Editor.SceneView.Tests
  • MeshesVixen.Editor.SceneView.Tests
  • ModelCompilerVixen.Editor.Assets
  • ModelImporterVixen.Editor.Assets
  • ModelImporterTestsVixen.Editor.Assets.Tests
  • ModelReaderVixen.Editor.Assets
  • ModelReaderTestsVixen.Editor.Assets.Tests
  • NavMeshImporterVixen.Editor.Assets