image_shader(3)
π image_shader(3) β like, the Arcan Lua API one, bestie β¨
okay so this page lives in section 3 of the manual and it's all about image_shader β setting the active shader for an object. literally that's the whole vibe. let's get into it π«Ά
β¨ NAME β¨
image_shader β set the active shader for an object. that's it, that's the job, and it ate π
π¦ SYNOPSIS π¦
oldshid
image_shader( vid:image, string:identifier )
image_shader( vid:image, integer:identifier )
image_shader( vid:image, string:identifier, integer:attributes )
image_shader( vid:image, integer:identifier, integer:attributes )
so there's four ways to call her, and yes oldshid is just sitting up there on its own line, iconic behavior, love that for her πΈ
π DESCRIPTION π
okay so processing programs can be created using the build_shader call, right? and then β plot twist β those programs can get assigned to an image through this function. main character energy honestly π
if attributes are provided, the value is expected to be one of these constants:
SHADER_DOMAIN_RENDERTARGETβ find a rendertarget bound to image and assign the shader as the default program for objects using this rendertarget. if image does not contain a rendertarget, it is a terminal state transition. yes, terminal. it's giving final boss πSHADER_DOMAIN_RENDERTARGET_HARDβ same as forSHADER_DOMAIN_RENDERTARGET, except all shaders on objects attached to the rendertarget will be ignored. this is useful for a temporary suspension of all shaders, as well as for rendertargets created usingdefine_linktarget. no cap, this is the "everybody chill for a sec" mode π
π NOTES π
- if only the vid is provided, the active program won't be changed, and the function is then used to query the active program of a video object. so, like, she's just reading the room, not touching anything π§
- if a string argument is supplied as the second argument, the routine will first resolve it by looking for a previously compiled shader with a name that matches the argument. name match, periodt β
- the shader state of all video objects are set to
' DEFAULT 'which is some platform default safe sate that followsobj_opacityand normal texturing. (yes, the original says "sate", we're keeping her exactly as she is, she's doing great π)
ngl note 3 is the one you wanna tattoo on your brain β the default state is a safe state, so nothing's out here doing unhinged things before you touch it β¨
π EXAMPLE π
function image_shader0()
shid = build_shader(nil, [[
void image_shader0(){
gl_FragColor = vec4(0.5, 1.0, 0.5, 1.0);
}
]], "demoshader");
a = fill_surface(64, 64, 0, 0, 0);
show_image(a);
image_shader(a, shid);
end
look at her go β build the shader, make a 64 by 64 surface, show it, slap the shader on it. the whole pipeline in five lines, we love a concise queen π
π
π₯ SEE ALSO π₯
go read those next, iykyk, they're the friend group π«Ά
and that's the page bestie!! πΈ this whole thing came from the image manual, dated October 2026, and yeah she's stamped image_shader(3) at the bottom too because consistency is a lifestyle πβ¨
π¦ 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