random_surface(3)
π NAME π
okay bestie, welcome to random_surface(3) from the Arcan Lua API β the page for random_surface β Generate a pseudo-random image surface. β¨
β¨ SYNOPSIS β¨
vid
random_surface( int:width, int:height )
random_surface( int:width, int:height, string:method=uniform-3 )
random_surface( int:width, int:height, string:method=uniform-4 )
random_surface( int:width, int:height, string:method=fbm,
float:lacunarity, float:gain, float:octaves, int:xstart, int:ystart,
int:z )
random_surface( width, height, method )
π¦ DESCRIPTION π¦
This function is used to create pseudorandom noise textures β itβs a useful building block in many graphics effects, no cap. π¨
- No method, or an unknown method β it defaults to 1 channel randomness from the global
csprng, duplicated into the RGB channels of a RGBA destination buffer (A=fully opaque). π uniform-3anduniform-4β these other methods work similarly, but have different values in 3 or all 4 channels. π¦fbmβ creates fractal noise by adding multiple octaves of perlin noise together. πΈ
Lowkey important: if the method is missing or unknown, it falls back to that default random mode instead of doing something dramatic. Periodt. π
π EXAMPLE π
Hereβs the example, copied exactly because we do not mess with code, bestie:
function random_surface0()
a = random_surface(64, 64);
b = random_surface(64, 64, "uniform-3");
c = random_surface(64, 64, "fbm", 2, 0.5, 6, 0, 0, 0);
show_image({a,b,c});
move_image(b, 64, 0);
move_image(c, 0, 64);
end
mwah π β source/version: image; date: October 2026. Arcan Lua API bestie out. ππ«Ά
π¦ 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