Click or drag to resize
DigitalRuneSubmesh Class
Represents a batch of geometry information to submit to the graphics device during rendering.
Inheritance Hierarchy
SystemObject
  DigitalRune.GraphicsSubmesh

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public class Submesh : IDisposable

The Submesh type exposes the following members.

Constructors
  NameDescription
Public methodSubmesh
Initializes a new instance of the Submesh class.
Top
Methods
  NameDescription
Public methodDispose
Releases all resources used by an instance of the Submesh class.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the Submesh class and optionally releases the managed resources.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodDraw
Draws the Submesh using the currently active shader.
(Defined by MeshHelper.)
Public Extension MethodGetMaterial
Gets the material of a submesh.
(Defined by MeshHelper.)
Public Extension MethodSetMaterial
Sets the material for a submesh.
(Defined by MeshHelper.)
Public Extension MethodToTriangleMeshOverloaded.
Creates a TriangleMesh from a Submesh.
(Defined by MeshHelper.)
Public Extension MethodToTriangleMesh(TriangleMesh)Overloaded.
Adds the triangles from the specified Submesh to a TriangleMesh.
(Defined by MeshHelper.)
Top
Properties
  NameDescription
Public propertyIndexBuffer
Gets or sets the index buffer.
Public propertyMaterialIndex
Gets or sets or sets the index of the material.
Public propertyMesh
Gets the mesh that own this submesh.
Public propertyMorphTargets
Gets or sets the morph targets of the submesh.
Public propertyPrimitiveCount
Gets or sets the number of primitives (usually the number of triangles).
Public propertyPrimitiveType
Gets or sets the type of the primitive.
Public propertyStartIndex
Gets or sets the location in the index array at which to start reading vertices.
Public propertyStartVertex
Gets or sets the index of the first vertex in the vertex buffer that belongs to this submesh (a.k.a base vertex or vertex offset).
Public propertyUserData
Gets or sets user-defined data.
Public propertyVertexBuffer
Gets or sets the vertex buffer.
Public propertyVertexCount
Gets or sets the number of vertices.
Top
Remarks

A Mesh has a collection of Materials and is subdivided into several submeshes. Each Submesh describes a batch of primitives that use the same vertex buffer and the same material, which means a submesh can be rendered with one draw call.

The submesh references a VertexBuffer and an IndexBuffer. These buffers are usually shared with other submeshes of the same model.

The submesh uses a continuous part of the VertexBuffer, starting at StartVertex and containing VertexCount vertices. The submesh also uses a continuous part of the IndexBuffer, starting at StartIndex. PrimitiveCount defines the number of primitives (usually triangles) that belong to this submesh.

See Also