vr_metadata(3)

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

πŸŽ€ 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 pixels
  • height β€” display vertical resolution in pixels
  • center β€” distance from edge to center, (m)
  • left_fov β€” left field of view
  • right_fov β€” right field of view
  • left_ar β€” left aspect ratio
  • right_ar β€” right aspect ratio
  • hsep β€” horizontal separation
  • vpos β€” vertical position
  • horizontal β€” display horizontal physical size, in m
  • vertical β€” display vertical physical size, in m
  • eye_display β€” distance from eyes to display, in m
  • ipd β€” interpupillary distance, in m
  • distortion β€” subtable of 4 floats with lens distortion data
  • abberation β€” subtable of 4 floats with lens distortion data (yes, abberation with two b’s β€” that’s the key name, don’t come for me πŸ’€)
  • projection_left β€” suggested HMD left eye projection matrix
  • projection_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 πŸ‘€

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