MeshFilters

MeshFilters

Methods

<static>

DOC_TBA

<static>

Encodes floating-point mesh attribute values as two separate attributes to improve rendering precision using the same encoding as EncodedCartesian3.

This is commonly used to create high-precision position vertex attributes.

Parameters:
Name Type Argument Default Description
mesh Object The mesh to filter, which is modified in place.
attributeName String <optional>
'position' The name of the attribute.
attributeHighName String <optional>
'positionHigh' The name of the attribute for the encoded high bits.
attributeLowName String <optional>
'positionLow' The name of the attribute for the encoded low bits.
Throws:
Returns:
The modified mesh argument, with its encoded attribute.
Example
mesh = MeshFilters.encodeAttribute(mesh, 'position3D', 'position3DHigh', 'position3DLow');
See:

<static>

DOC_TBA. Old mesh is not guaranteed to be copied.

Throws:
  • DeveloperError : The mesh's index-lists must have PrimitiveType equal to PrimitiveType.TRIANGLES.
  • DeveloperError : All mesh attribute lists must have the same number of attributes.

<static>

DOC_TBA

<static>

DOC_TBA

<static>

Reorders a mesh's indices to achieve better performance from the GPU's post vertex-shader cache by using the Tipsify algorithm. Each list of indices in the mesh's indexList is optimally reordered.

The mesh argument should use the standard layout like the mesh returned by BoxTessellator.

Parameters:
Name Type Argument Default Description
mesh Object The mesh to filter, which is modified in place.
cacheCapacity Number <optional>
24 The number of vertices that can be held in the GPU's vertex cache.
Throws:
Returns:
The modified mesh argument, with its indices optimally reordered for the post-vertex-shader cache.
Example
var mesh = CubeMapEllipsoidTessellator.compute(...);
mesh = MeshFilters.reorderForPostVertexCache(mesh);
See:

<static>

Reorders a mesh's indices to achieve better performance from the GPU's pre-vertex-shader cache. Each list of indices in the mesh's indexList is reordered to keep the same index-vertex correspondence.

The mesh argument should use the standard layout like the mesh returned by BoxTessellator.

Parameters:
Name Type Description
mesh Object The mesh to filter, which is modified in place.
Throws:
DeveloperError : All mesh attribute lists must have the same number of attributes.
Returns:
The modified mesh argument, with its vertices and indices reordered for the GPU's pre-vertex-shader cache.
Example
var mesh = CubeMapEllipsoidTessellator.compute(...);
mesh = MeshFilters.reorderForPreVertexCache(mesh);
See:

<static>

Converts a mesh's triangle indices to line indices. Each list of indices in the mesh's indexList with a primitive type of triangles, triangleStrip, or trangleFan is converted to a list of indices with a primitive type of lines. Lists of indices with other primitive types remain unchanged.

The mesh argument should use the standard layout like the mesh returned by BoxTessellator.

This filter is commonly used to create a wireframe mesh for visual debugging.

Parameters:
Name Type Description
mesh Object The mesh to filter, which is modified in place.
Returns:
The modified mesh argument, with its triangle indices converted to lines.
Example
var mesh = BoxTessellator.compute();
mesh = MeshFilters.toWireframeInPlace(mesh);
See: