rendertarget_noclear(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

πŸ’… rendertarget_noclear β€” the Arcan Lua API one, bestie

okay so real talk, this is rendertarget_noclear(3), straight out of the Arcan Lua API, and it's lowkey one of those tiny functions that does one thing and does it iconically.


✨ NAME ✨

rendertarget_noclear β€” turn the "clear the rendertarget before a renderpass" behaviour on or off. That's it. That's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

success
rendertarget_noclear( vid, noclear )

🌸 DESCRIPTION 🌸

so by default, every single pass for a rendertarget starts by clearing the buffer it's about to draw to. like, every time, no asking, just yeet the pixels.

and that's fine! except πŸ‘€ it can waste memory bandwidth if you already know the entire rendertarget is gonna get fully populated by the objects you're drawing anyway. why clear a thing you're about to completely cover? exactly. that's the moment rendertarget_noclear walks in.

it changes that behaviour β€” you set a true value to a vid that's connected to a rendertarget, and boom, the clearing dips. slay. ✨


πŸ‘‘ NOTES πŸ‘‘

  1. setting WORLDID as vid will change the clear behaviour for the standard output rendertarget. main character energy, honestly.
  2. okay this one's important, no cap: if the background is not actually covered by valid VID s, you will leave trails of previous frames behind. that's the MAIN example below, and it's giving ghosting. mind the trails. πŸ’€

πŸ”₯ EXAMPLE πŸ”₯

function rendertarget_noclear0()
      rendertarget_noclear(WORLDID, true);
      a = color_surface(64, 64, 255, 0, 0, 0);
      show_image(a);
      move_image(a, 128, 128, 10);
end

πŸ™ˆ MISUSE πŸ™ˆ

function rendertarget_noclear0()
      rendertarget_noclear(BADID, "potatoe");
end

not the "potatoe" 😭 bestie, BADID and a string of all things. this is what we in the business call not it. πŸ’…


🌈 that's a wrap 🌈

this page came to you courtesy of targetcontrol, dated October 2026 β€” and it's the rendertarget_noclear(3) manual page, so go forth and clear responsibly (or don't, that's literally the point 🫢). πŸ’–

πŸ“¦ where this page comes from