Core · spatial
Portal Warp — Perspective Correction (DEAD CODE)
Homography-based GLSL shaders for mapping compositor output onto AR glasses with head-tracking correction. Currently dead code — Wayfire's built-in perspective-warp is used instead.
Architecture
Overview
portal-warp was designed to provide perspective correction for the AR glasses display — mapping the compositor's flat output onto the glasses' curved field of view with head-tracking compensation. It includes a WarpRenderer that manages OpenGL state, compiles custom GLSL shaders, and applies homography-based transforms. However, the crate is currently dead code: the C++ Wayfire shim uses Wayfire's built-in perspective-warp rendering pipeline instead of calling into these functions. The crate is retained because removal would require touching the CMake build and the C++ shim's dlopen path. Scheduled for removal once the C++ shim is fully excised.
Key Types
Modules
error
WarpError enum — shader compilation errors, GL errors, invalid homography matrices.
homography
Homography matrix operations shared with portal-spatial — DLT solver, point transformation.
shader
GLSL shader compilation and GL state management — vertex/fragment shaders, uniform setting, texture binding.
renderer
WarpRenderer — manages the complete rendering pipeline: VBO setup, shader program, FBO for offscreen rendering, draw calls.
Data Flow
UNUSED — would have been: compositor output → WarpRenderer applies homography shader → warped texture → glasses display
Dependencies
External (3)
DEAD CODE — 6 P0/P1 security findings accepted as documented risk. See .omo/plans/audit-remediation.md Wave 5.B / todo 76.