vr_metadata(3)
π vr_metadata(3) π
okay so bestie, this page is from the Arcan Lua API and itβs literally here to retrieve metadata from a vr bridge. slay.
πΈ NAME πΈ
vr_metadata β retrieve metadata from a vr bridge
β¨ SYNOPSIS β¨
strtbl or nil
vr_metadata( vid:id )
π DESCRIPTION π
okay so to set up a useful 3d pipeline for working with HMD s, you need access to some metadata. no cap. This function retrieves a table of the relevant parameters you need for creating a distortion mesh or a barrel distortion shader that tmach β yes, tmach, keeping the sourceβs spelling, mwah π β the specified vr device.
The currently available keys in strtbl are:
widthβ display horizontal resolution in pixelsheightβ display vertical resolution in pixelscenterβ distance from edge to center, (m)left_fovβ left field of viewright_fovβ right field of viewleft_arβ left aspect ratioright_arβ right aspect ratiohsepβ horizontal separationvposβ vertical positionhorizontalβ display horizontal physical size, in mverticalβ display vertical physical size, in meye_displayβ distance from eyes to display, in mipdβ interpupillary distance, in mdistortionβ subtable of 4 floats with lens distortion dataabberationβ subtable of 4 floats with lens distortion data (yes,abberationwith two bβs β thatβs the key name, donβt come for me π)projection_leftβ suggested HMD left eye projection matrixprojection_rightβ suggesteed HMD right eye projection matrix (their spelling, not mine π )
If the metadata couldn't be accessed at this time due to some problem with the internal state of the vr bridge, or if id doesn't refer to a valid vrbridge instance, the function will return nil. The best indicator for if the bridge metadata has been available or not is after a 'limb_added' event. π«Ά
π¦ EXAMPLE π¦
function vr_metadata0()
local bridge = vr_setup("test",
function(source, status)
if (status.kind == "limb_added") then
local tbl = vr_metadata(source);
if (tbl) then
print(string.format(
"test-hmd values:0idthxheight - %f x %f0 ..
"horiz, vert, center: %f , %f , %f0 ..
"eye_display, ipd: %f , %f0,
tbl.width, tbl.height, tbl.center, tbl.horizontal,
tbl.vertical, tbl.eye_display, tbl.ipd)
);
end
shutdown();
end
end);
end
π SEE ALSO π
vr_setup(3)vr_maplimb(3)
go read those too, bestie β iykyk πβ¨
mwah π β this iconic little page is brought to you by iodev, stamped October 2026. π
π¦ 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