Files
craft-libs/crates
dotCooCoo ce361b210d craft-texture: add mip chains with footprint-based level choice
mip::MipChain builds every level below an image down to 1 x 1 with a
box filter in f64. Each side is halved and rounded down to at least 1,
as the Vulkan specification (section 12.4.4) and
ARB_texture_non_power_of_two size levels; on an odd side the last
texel averages the last three source texels. Channels, alpha included,
are averaged on their own as linear data.

lod() takes the screen-space derivatives of (u, v) and returns
log2 of the longer scaled footprint plus the sampler bias, clamped to
min_lod..=max_lod, as section 20.3.7 defines it. select() picks the
nearest level (a tie takes the lower-numbered level) or two levels and
their blend, and sample_grad() and sample_lod() read them with the
per-axis wrap modes and the magnification or minification texel filter
of section 20.6.3. MipMinFilter::from_gltf and TexelFilter::from_gltf
read the glTF 2.0 sampler codes. from_levels() takes levels made
elsewhere and checks their sizes and kinds.

Every level is checked against MipLimits::image and the bytes of all
levels against max_chain_bytes (default 1.5 GiB) before anything is
allocated; required_bytes() makes the same check for a size alone.
NaN or infinite derivatives, LODs, biases and bounds, and min_lod above
max_lod, return a MipError.
2026-11-21 04:38:47 -08:00
..
2026-11-14 17:49:47 +01:00
2026-11-13 01:31:26 -05:00
…