new VertexFormat(optionsopt)
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.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Object |
<optional> |
An object with boolean properties corresponding to VertexFormat properties as shown in the code example. |
- Source:
- See:
-
- Geometry#attributes
- Packable
Example
// Create a vertex format with position and 2D texture coordinate attributes.
var format = new Cesium.VertexFormat({
position : true,
st : true
});
Members
(static, constant) ALL :VertexFormat
An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent.
Type:
- Source:
- See:
(static, constant) DEFAULT :VertexFormat
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.
Type:
- Source:
- See:
(static) packedLength :Number
The number of elements used to pack the object into an array.
Type:
- Number
- Source:
(static, constant) POSITION_AND_COLOR :VertexFormat
An immutable vertex format with position and color attributes.
Type:
- Source:
- See:
(static, constant) POSITION_AND_NORMAL :VertexFormat
An immutable vertex format with position and normal attributes.
This is compatible with per-instance color appearances like
PerInstanceColorAppearance
.
Type:
- Source:
- See:
(static, constant) POSITION_AND_ST :VertexFormat
An immutable vertex format with position and st attributes.
This is compatible with
EllipsoidSurfaceAppearance
.
Type:
- Source:
- See:
(static, constant) POSITION_NORMAL_AND_ST :VertexFormat
An immutable vertex format with position, normal, and st attributes.
This is compatible with
MaterialAppearance
when MaterialAppearance#materialSupport
is TEXTURED/code>.
Type:
- Source:
- See:
(static, constant) POSITION_ONLY :VertexFormat
An immutable vertex format with only a position attribute.
Type:
- Source:
- See:
binormal :Boolean
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.
Type:
- Boolean
- Default Value:
- false
- Source:
color :Boolean
When
true
, the vertex has an RGB color attribute.
8-bit unsigned byte. 3 components per attribute.
Type:
- Boolean
- Default Value:
- false
- Source:
normal :Boolean
When
true
, the vertex has a normal attribute (normalized), which is commonly used for lighting.
32-bit floating-point. 3 components per attribute.
Type:
- Boolean
- Default Value:
- false
- Source:
position :Boolean
When
true
, the vertex has a 3D position attribute.
64-bit floating-point (for precision). 3 components per attribute.
Type:
- Boolean
- Default Value:
- false
- Source:
st :Boolean
When
true
, the vertex has a 2D texture coordinate attribute.
32-bit floating-point. 2 components per attribute
Type:
- Boolean
- Default Value:
- false
- Source:
tangent :Boolean
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.
Type:
- Boolean
- Default Value:
- false
- Source:
Methods
(static) clone(cartesian, resultopt) → {VertexFormat}
Duplicates a VertexFormat instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cartesian |
VertexFormat | The vertex format to duplicate. | |
result |
VertexFormat |
<optional> |
The object onto which to store the result. |
- Source:
Returns:
The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)
- Type
- VertexFormat
(static) pack(value, array, startingIndexopt) → {Array.<Number>}
Stores the provided instance into the provided array.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
VertexFormat | The value to pack. | ||
array |
Array.<Number> | The array to pack into. | ||
startingIndex |
Number |
<optional> |
0 | The index into the array at which to start packing the elements. |
- Source:
Returns:
The array that was packed into
- Type
- Array.<Number>
(static) unpack(array, startingIndexopt, resultopt) → {VertexFormat}
Retrieves an instance from a packed array.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
array |
Array.<Number> | The packed array. | ||
startingIndex |
Number |
<optional> |
0 | The starting index of the element to be unpacked. |
result |
VertexFormat |
<optional> |
The object into which to store the result. |
- Source:
Returns:
The modified result parameter or a new VertexFormat instance if one was not provided.
- Type
- VertexFormat