meshopt

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0, MIT Imports: 3 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 meshoptimizer bitstreams used by the EXT_meshopt_compression and KHR_meshopt_compression glTF extensions in pure Go: the attribute codec (versions 0 and 1), the triangle and index sequence codecs, and the octahedral, quaternion, exponential and color filters.

It is a port, modified for Go, of the scalar reference decoder in meshoptimizer 0.25 (https://github.com/zeux/meshoptimizer, Copyright (c) 2016-2025 Arseny Kapoulkine, MIT License; see the LICENSE file in this directory), and rejects truncated or malformed streams with an error instead of reading out of bounds.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrHeader reports an unknown header byte or unsupported codec version.
	ErrHeader = errors.New("meshopt: invalid header or unsupported version")
	// ErrData reports a truncated stream, trailing bytes or a malformed block.
	ErrData = errors.New("meshopt: malformed or truncated data")
	// ErrLayout reports an element size or count the codec cannot represent.
	ErrLayout = errors.New("meshopt: invalid element size or count")
)

Errors returned for streams that cannot be decoded.

Functions

func DecodeFilterColor

func DecodeFilterColor(data []byte, count, stride int) error

DecodeFilterColor decodes count YCoCg-encoded colors stored as 4 unsigned bytes (stride 4) or 4 unsigned 16-bit integers (stride 8).

func DecodeFilterExp

func DecodeFilterExp(data []byte, count, stride int) error

DecodeFilterExp decodes count elements of stride bytes holding 32-bit values with an 8-bit exponent and a 24-bit signed mantissa.

func DecodeFilterOct

func DecodeFilterOct(data []byte, count, stride int) error

DecodeFilterOct decodes count octahedral-encoded unit vectors stored as 4 signed bytes (stride 4) or 4 signed 16-bit integers (stride 8).

func DecodeFilterQuat

func DecodeFilterQuat(data []byte, count, stride int) error

DecodeFilterQuat decodes count quaternions stored as 4 signed 16-bit integers with the largest component reconstructed (stride 8).

func DecodeIndexBuffer

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

DecodeIndexBuffer decodes count triangle-list indices of size bytes (2 or 4) from the triangle codec stream data into dst.

func DecodeIndexSequence

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

DecodeIndexSequence decodes count indices of size bytes (2 or 4) from the index sequence codec stream data into dst.

func DecodeVertexBuffer

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

DecodeVertexBuffer decodes count elements of size bytes (a multiple of 4, at most 256) from the attribute codec stream data into dst, which must hold count*size bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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