image_mipmap(3)
๐ฆ image_mipmap โ Arcan Lua API, bestie edition
okay so this one's from the Arcan Lua API manual and it's literally called image_mipmap, and ngl the vibe is "force-toggle image mipmap storage" โจ
๐ NAME
image_mipmap โ Forcetoggle image mipmap storage ๐
(yes, Forcetoggle is one word, that's how they wrote it, we respect the hyphen-free lifestyle)
โจ SYNOPSIS
nil
image_mipmap( vid, state )
๐ธ DESCRIPTION
okay so picture this: mipmapping is the super common procedure of generating multiple versions of the same image โ typically at lower resolutions for each "level" โ and then letting the rendering subsystem decide which version is the most suitable for whatever rendering operation is happening right now ๐
the way it works out: this usually saves on memory bandwidth, at the cost of approximately a third more memory consumption. tradeoffs, we love them.
this function enforces a certain mipmap state for a video object ๐ซถ. and heads up โ some filtering methods rely on access to lower mipmap levels, FILTER_TRILINEAR in particular. so if you're running trilinear and the lower levels aren't thereโฆ yeah ๐
โญ NOTES
- this is a no-operation in memory conservative mode ๐
- the default mipmap state for all objects is determined at compile time (
ARCAN_VIDEO_DEFAULT_MIPMAP_STATE), with hardcoded mipmap disable defaults for frameservers and for rendertarget storage ๐ - the engine does not currently support manually generated mipmaps ๐ญ these can be useful in some contexts, particularly when dealing with texture compression, or when optimizing memory use through pre-pass analysis of visibility with color-coded mipmap levels. so like โ useful, yes, supported, no ๐
- this state transformation is costly with non-trivially determined benefits. in order to reliably switch open GL backend state, a new GL store needs to be created, thus the raw texture data is copied and uploaded again ๐ฎโ๐จ like, full re-upload. not free. no cap.
lowkey read note 4 twice before you sprinkle image_mipmap calls everywhere, bestie ๐ซถ
๐ EXAMPLE
function image_mipmap0()
icon = load_image("test.png");
props = image_surface_properties(icon);
icon2 = null_surface(props.width, props.height);
icon2 = image_sharestorage(icon, icon2);
show_image({icon, icon2});
resize_image(icon, props.width * 0.5, props.height * 0.5);
resize_image(icon2, props.width * 0.5, props.height * 0.5);
move_image(icon2, props.width, 0);
image_mipmap(icon2, false);
image_mipmap(icon, true);
end
two surfaces sharing storage, both resized to half size, one moved over next to the other, and then the mipmap states get flipped in opposite directions โ one false, one true. a little side-by-side comparison moment, iykyk ๐
๐ MISUSE
function image_mipmap0()
image_mipmap(WORLDID, "potatoe");
end
not the "potatoe" ๐ญ๐ญ this is the "don't do this" example โ a WORLDID where a video object id belongs, and a string where a state belongs. bestie. respectfully. do not ๐ซ
๐ซถ SEE ALSO:
image
and that's the whole page, fr fr ๐ โ this icon of a manpage is from the Arcan Lua API manual, page dated October 2026, and the source line at the bottom just says image. slay, we love a tidy footer ๐โจ
๐ฆ where this page comes from
- nixos 26.05: arcan 0.7.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms