code wiki / _hdl_build / nx_vrframe.nx
nx_vrframe.nx
buildroot/runtime/_hdl_build/nx_vrframe.nx
about
nx_vrframe.nx -- F1106 VR-RUNTIME RUNG 1: the SOVEREIGN VR COMPOSITOR FRAME (operator 2026-08-10:
"do you know how to actually build a vr hot and virtamate" -> the one honest GAP is the headset
runtime; stereo already exists 4/4). This organ produces the SUBMIT-READY frame a VR compositor
hands to a headset: two eye views with horizontal parallax (off-axis pinhole per eye) THROUGH the
OpenXR-standard radial LENS PRE-DISTORTION (barrel warp r' = r*(1+k1*r^2+k2*r^4)), so the pincushion
lens un-warps it to rectilinear -- the characteristic rounded VR frame with black corners.
NEVER-BRICK BY CONSTRUCTION (Rule 26): pure compute + ONE regular-file PNG write. It touches NO
device/firmware/CMOS/vBIOS namespace -- there is no code path here that can write persistent hardware
state, and the gate proves the output sink is a regular knowledge/sites path, never /dev|/sys|/proc.
Scene is a deterministic 3D depth test (receding checker floor + depth-sorted pillars) chosen because
stereo/lens correctness is what rung 1 proves; the SUBJECT (a VaM-class figure) composes later off the
certified body lane. Emits knowledge/nx_vrframe.png (1024x512 L|R) + sites/nishifamily/world/vrframe.png.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_png.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 16 | const VF_MAGIC_374761393: i64 = 374761393 |
| 17 | const VF_MAGIC_668265263: i64 = 668265263 |
| 18 | const VF_MAGIC_1274126177: i64 = 1274126177 |
| 19 | const VF_MAGIC_1180: i64 = 1180 |
| 20 | const VF_MAGIC_1600: i64 = 1600 |
| 21 | const VF_MAGIC_2100: i64 = 2100 |
| 22 | const VF_MAGIC_2900: i64 = 2900 |
| 24 | const VF_EW: i64 = 384 |
| 25 | const VF_EH: i64 = 384 |
| 26 | const VF_FOCAL: i64 = 420 |
| 27 | const VF_CAMY: i64 = 165 // eye height above the floor (world units) |
| 28 | const VF_IPD: i64 = 62 // half interpupillary offset in world units (per eye, +/-) |
| 29 | const VF_FX: i64 = 1024 // fixed-point unit for the distortion polynomial |
| 30 | const VF_K1: i64 = 120 // barrel radial coefficients (pincushion-lens inverse) |
| 31 | const VF_K2: i64 = 40 |
| 32 | const VF_TILE: i64 = 130 // floor checker tile (world units) |
| 33 | const VF_65536: i64 = 65536 |
functions
| 35 | func vw2(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 36 | func vn2(v: i64) -> i64 |
| 46 | func vf_clamp(v: i64, lo: i64, hi: i64) -> i64 { if v<lo {return lo} if v>hi {return hi} return v } |
| 47 | func vf_pack(r: i64, g: i64, b: i64) -> i64 |
| 50 | func vf_hash(a: i64, b: i64) -> i64 |
| 59 | func vf_np() -> i64 { return 6 } |
| 60 | func vf_pill(i: i64, k: i64) -> i64 |
| 73 | func vf_render_eye(eyeX: i64, out: *i64, px: *i64) -> i64 |
| 158 | func vf_distort(src: *i64, dst: *i64, distort: i64) -> i64 |
| 188 | func vf_build(distort: i64, outpath: *u8) -> i64 |
| 216 | func main(argc: i64, argv: *i64) -> i64 |