Skip to main content

compress_uvs

Function compress_uvs 

Source
pub fn compress_uvs<'a>(
    uvs: &'a [[f32; 2]],
    out_meta: &mut MeshMetadata,
) -> impl Iterator<Item = CompressedUv> + 'a
Expand description

Compress UVs into Snorm16x2 remapped by their bounding box, writing the decode parameters into out_meta.uv_min_and_extents.

The returned iterator is lazy: nothing is allocated, and a caller can stream the values straight into a GPU buffer.

ยงPanics

If uvs is empty.