GeometryPipeline

external object GeometryPipeline(source)

Content pipeline functions for geometries.

See also

Functions

Link copied to clipboard

Compresses and packs geometry normal attribute values to save memory.

Link copied to clipboard

Computes per-vertex normals for a geometry containing TRIANGLES by averaging the normals of all triangles incident to the vertex. The result is a new normal attribute added to the geometry. This assumes a counter-clockwise winding order.

Link copied to clipboard

Computes per-vertex tangents and bitangents for a geometry containing TRIANGLES. The result is new tangent and bitangent attributes added to the geometry. This assumes a counter-clockwise winding order.

Link copied to clipboard

Creates an object that maps attribute names to unique locations (indices) for matching vertex attributes and shader programs.

Link copied to clipboard
fun createLineSegmentsForVectors(geometry: Geometry, attributeName: String? = definedExternally, length: Int? = definedExternally): Geometry

Creates a new Geometry with LINES representing the provided attribute (attributeName) for the provided geometry. This is used to visualize vector attributes like normals, tangents, and bitangents.

Link copied to clipboard
fun encodeAttribute(geometry: Geometry, attributeName: String, attributeHighName: String, attributeLowName: String): Geometry

Encodes floating-point geometry attribute values as two separate attributes to improve rendering precision.

Link copied to clipboard

Splits a geometry into multiple geometries, if necessary, to ensure that indices in the indices fit into unsigned shorts. This is used to meet the WebGL requirements when unsigned int indices are not supported.

Link copied to clipboard
fun projectTo2D(geometry: Geometry, attributeName: String, attributeName3D: String, attributeName2D: String, projection: Any? = definedExternally): Geometry

Projects a geometry's 3D position attribute to 2D, replacing the position attribute with separate position3D and position2D attributes.

Link copied to clipboard
fun reorderForPostVertexCache(geometry: Geometry, cacheCapacity: Int? = definedExternally): Geometry

Reorders a geometry's indices to achieve better performance from the GPU's post vertex-shader cache by using the Tipsify algorithm. If the geometry primitiveType is not TRIANGLES or the geometry does not have an indices, this function has no effect.

Link copied to clipboard

Reorders a geometry's attributes and indices to achieve better performance from the GPU's pre-vertex-shader cache.

Link copied to clipboard
fun toWireframe(geometry: Geometry): Geometry

Converts a geometry's triangle indices to line indices. If the geometry has an indices and its primitiveType is TRIANGLES, TRIANGLE_STRIP, TRIANGLE_FAN, it is converted to LINES; otherwise, the geometry is not changed.

Link copied to clipboard

Transforms a geometry instance to world coordinates. This changes the instance's modelMatrix to Matrix4.IDENTITY and transforms the following attributes if they are present: position, normal, tangent, and bitangent.