meshopt

package
v1.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package meshopt decodes the data of EXT_meshopt_compression (SPEC §28.5): the vertex buffers, the index buffers and the index sequences of meshoptimizer's formats (versions 0 and 1), and its four vertex filters. It is plain Go with no OS tags.

The decoders are translated to Go and changed from src/vertexcodec.cpp, src/indexcodec.cpp and src/vertexfilter.cpp of meshoptimizer 1.3 (MIT license, third_party/meshoptimizer/LICENSE). Only the scalar paths are ported (the SIMD ones give the same bytes), every read is checked against the end of the data, and a failure is an error with a reason instead of a negative code.

Index

Constants

View Source
const TagMeshoptFilterInvalid = "MeshoptFilterInvalid"

TagMeshoptFilterInvalid is the tag of the error of a filter that is asked for a stride it does not have, or for data shorter than its count says. The metadata has "reason", "filter", "count" and "stride".

Flutter: no counterpart

View Source
const TagMeshoptIndexInvalid = "MeshoptIndexInvalid"

TagMeshoptIndexInvalid is the tag of the error of an index buffer or an index sequence that is malformed: a header that is not one, a version that is not known, data that is too short or too long for the count. The metadata has "reason" and "bytes".

Flutter: no counterpart

View Source
const TagMeshoptVertexInvalid = "MeshoptVertexInvalid"

TagMeshoptVertexInvalid is the tag of the error of a vertex buffer that is malformed: a header that is not one, a version that is not known, data that is too short or too long for the count and the size, a channel that is not a type. The metadata has "reason", "count", "size" and "bytes".

Flutter: no counterpart

Variables

This section is empty.

Functions

func DecodeFilter

func DecodeFilter(filter Filter, data []byte, count, stride int) error

DecodeFilter applies the filter to count elements of stride bytes each in data, in place. It fails with TagMeshoptFilterInvalid when the stride is not one that the filter has.

Flutter: no counterpart

func DecodeIndexBuffer

func DecodeIndexBuffer(indices []uint32, data []byte) error

DecodeIndexBuffer decodes the triangle index buffer in data into indices, whose length is the number of indices (a multiple of three). It fails with TagMeshoptIndexInvalid when the data is not a version 0 or 1 index buffer of exactly that many indices.

Flutter: no counterpart

func DecodeIndexSequence

func DecodeIndexSequence(indices []uint32, data []byte) error

DecodeIndexSequence decodes the index sequence in data (the indices of points or lines, or of any list that is not a mesh) into indices. It fails with TagMeshoptIndexInvalid when the data is not a version 0 or 1 index sequence of exactly that many indices.

Flutter: no counterpart

func DecodeVertexBuffer

func DecodeVertexBuffer(dst []byte, count, size int, data []byte) error

DecodeVertexBuffer decodes count vertices of size bytes each (a multiple of four, at most 256) from data into dst, which has count*size bytes. It fails with TagMeshoptVertexInvalid when the data is not a version 0 or 1 vertex buffer of exactly that many vertices.

Flutter: no counterpart

Types

type Filter

type Filter int

Filter is a vertex filter of EXT_meshopt_compression: what is done to the decoded vertices to get their attributes.

Flutter: no counterpart

const (
	FilterNone Filter = iota
	// FilterOctahedral is for normals and tangents of 4 bytes (8 bit components) or 8 bytes (16 bit components).
	FilterOctahedral
	// FilterQuaternion is for rotations of 8 bytes (16 bit components).
	FilterQuaternion
	// FilterExponential is for floats of a multiple of 4 bytes, each a 24 bit mantissa and an 8 bit exponent.
	FilterExponential
	// FilterColor is for colors of 4 bytes (8 bit components) or 8 bytes (16 bit components).
	FilterColor
)

The filters of the extension. FilterNone leaves the bytes as the vertex decoder made them.

Flutter: no counterpart

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL