# VertexFormat

#### new Cesium.VertexFormat(options)
Core/VertexFormat.js 34

  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 | optional An object with boolean properties corresponding to VertexFormat properties as shown in the code example.

  ##### Example:

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

  ##### See:

  - Geometry#attributes
  - Packable

### Members

#### static constantCesium.VertexFormat.ALL : VertexFormat
Core/VertexFormat.js 196

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

  ##### See:

  - VertexFormat#position
  - VertexFormat#normal
  - VertexFormat#st
  - VertexFormat#binormal
  - VertexFormat#tangent

#### static constantCesium.VertexFormat.DEFAULT : VertexFormat
Core/VertexFormat.js 216

  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:

  - VertexFormat#position
  - VertexFormat#normal

#### staticCesium.VertexFormat.packedLength : Number
Core/VertexFormat.js 222

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

#### static constantCesium.VertexFormat.POSITION_AND_COLOR : VertexFormat
Core/VertexFormat.js 179

  An immutable vertex format with position and color attributes.

  ##### See:

  - VertexFormat#position
  - VertexFormat#color

#### static constantCesium.VertexFormat.POSITION_AND_NORMAL : VertexFormat
Core/VertexFormat.js 132

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

  ##### See:

  - VertexFormat#position
  - VertexFormat#normal

#### static constantCesium.VertexFormat.POSITION_AND_ST : VertexFormat
Core/VertexFormat.js 165

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

  ##### See:

  - VertexFormat#position
  - VertexFormat#st

#### static constantCesium.VertexFormat.POSITION_NORMAL_AND_ST : VertexFormat
Core/VertexFormat.js 149

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

  ##### See:

  - VertexFormat#position
  - VertexFormat#normal
  - VertexFormat#st

#### static constantCesium.VertexFormat.POSITION_ONLY : VertexFormat
Core/VertexFormat.js 118

  An immutable vertex format with only a position attribute.

  ##### See:

  - VertexFormat#position

#### binormal : Boolean
Core/VertexFormat.js 83

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

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

  Default Value: `false`

#### color : Boolean
Core/VertexFormat.js 107

  When `true`, the vertex has an RGB color attribute.

  8-bit unsigned byte. 3 components per attribute.

  Default Value: `false`

#### normal : Boolean
Core/VertexFormat.js 59

  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`

#### position : Boolean
Core/VertexFormat.js 47

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

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

  Default Value: `false`

#### st : Boolean
Core/VertexFormat.js 71

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

  32-bit floating-point. 2 components per attribute

  Default Value: `false`

#### tangent : Boolean
Core/VertexFormat.js 95

  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

#### staticCesium.VertexFormat.clone(cartesian, result) → VertexFormat
Core/VertexFormat.js 288

  Duplicates a VertexFormat instance.

  Name | Type | Description
  --- | --- | ---
  `cartesian` | VertexFormat | The vertex format to duplicate.
  `result` | VertexFormat | optional The object onto which to store the result.

  ##### Returns:

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

#### staticCesium.VertexFormat.pack(value, array, startingIndex)
Core/VertexFormat.js 231

  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` | optional The index into the array at which to start packing the elements.

#### staticCesium.VertexFormat.unpack(array, startingIndex, result) → VertexFormat
Core/VertexFormat.js 259

  Retrieves an instance from a packed array.

  Name | Type | Default | Description
  --- | --- | --- | ---
  `array` | Array.<Number> |  | The packed array.
  `startingIndex` | Number | `0` | optional The starting index of the element to be unpacked.
  `result` | VertexFormat |  | optional The object into which to store the result.

  ##### Returns:

  The modified result parameter or a new VertexFormat instance if one was not provided.