image_mipmap(3)

๐Ÿ“ฆ
version 0.7.1 ยท 2 versions
, in nixos 26.05

๐Ÿฆ‹ 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

  1. this is a no-operation in memory conservative mode ๐Ÿ™ˆ
  2. 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 ๐ŸŽ€
  3. 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 ๐Ÿ’…
  4. 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