Class: VertexFormat

VertexFormat

new VertexFormat(options)

A vertex format defines what attributes make up a vertex. A VertexFormat can be provided to a Geometry to request that certain properties be computed, e.g., just position, position and normal, etc.

Name Type Description
options Object 可选

An object with boolean properties corresponding to VertexFormat properties as shown in the code example.

See:
Example
// Create a vertex format with position and 2D texture coordinate attributes.
var format = new SuperMap3D.VertexFormat({
  position : true,
  st : true
});

Members

(static, constant) ALLVertexFormat

An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.

See:

(static, constant) DEFAULTVertexFormat

An immutable vertex format with position, normal, and st attributes. This is compatible with most appearances and materials; however normal and st attributes are not always required. When this is known in advance, another VertexFormat should be used.

See:

static packedLengthNumber

The number of elements used to pack the object into an array.

(static, constant) POSITION_AND_COLORVertexFormat

An immutable vertex format with position and color attributes.

See:

(static, constant) POSITION_AND_NORMALVertexFormat

An immutable vertex format with position and normal attributes. This is compatible with per-instance color appearances like PerInstanceColorAppearance.

See:

(static, constant) POSITION_AND_STVertexFormat

An immutable vertex format with position and st attributes. This is compatible with EllipsoidSurfaceAppearance.

See:

(static, constant) POSITION_NORMAL_AND_STVertexFormat

An immutable vertex format with position, normal, and st attributes. This is compatible with MaterialAppearance when MaterialAppearance#materialSupport is TEXTURED/code>.

See:

(static, constant) POSITION_ONLYVertexFormat

An immutable vertex format with only a position attribute.

See:

bitangentBoolean

When true, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.

32-bit floating-point. 3 components per attribute.

Default Value:
false

colorBoolean

When true, the vertex has an RGB color attribute.

8-bit unsigned byte. 3 components per attribute.

Default Value:
false

heightBoolean

When true, the vertex has an height attribute.

8-bit floating-point. 1 per attribute.

Default Value:
false

normalBoolean

When true, the vertex has a normal attribute (normalized), which is commonly used for lighting.

32-bit floating-point. 3 components per attribute.

Default Value:
false

positionBoolean

When true, the vertex has a 3D position attribute.

64-bit floating-point (for precision). 3 components per attribute.

Default Value:
false

stBoolean

When true, the vertex has a 2D texture coordinate attribute.

32-bit floating-point. 2 components per attribute

Default Value:
false

tangentBoolean

When true, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.

32-bit floating-point. 3 components per attribute.

Default Value:
false

Methods

static clone(vertexFormat, result){VertexFormat}

Duplicates a VertexFormat instance.

Name Type Description
vertexFormat VertexFormat

The vertex format to duplicate.

result VertexFormat 可选

The object onto which to store the result.

Returns:
Type Description
VertexFormat The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)

static pack(value, array, startingIndex){Array.<Number>}

Stores the provided instance into the provided array.

Name Type Default Description
value VertexFormat

The value to pack.

array Array.<Number>

The array to pack into.

startingIndex Number 0 可选

The index into the array at which to start packing the elements.

Returns:
Type Description
Array.<Number> The array that was packed into

static unpack(array, startingIndex, result){VertexFormat}

Retrieves an instance from a packed array.

Name Type Default Description
array Array.<Number>

The packed array.

startingIndex Number 0 可选

The starting index of the element to be unpacked.

result VertexFormat 可选

The object into which to store the result.

Returns:
Type Description
VertexFormat The modified result parameter or a new VertexFormat instance if one was not provided.
Documentation generated by JSDoc on Wed Mar 04 2026 20:20:05 GMT+0800 (中国标准时间)