Building a VR Vision Therapy Game: Why We Chose Godot + Meta Quest for AmblyoPunch The viral 'lose 15lbs in a week' meme crossed my feed last week — 95 score on Lemmy, pure absurdity. It reminded me why we spent 18 months building AmblyoPunch: health gamification fails when it chases quick fixes. Real neuroplasticity needs daily reps, and the only way to keep patients coming back is to make those reps feel like play rather than a chore. That insight drove every architectural decision, from the engine we picked to the way we surface progress data on the headset itself.
We settled on Godot 4 with GDScript because it gives us a lightweight, fully open‑source runtime that compiles straight to the Quest’s Android‑based OS via the official OpenXR export template. The engine’s scene system maps cleanly to the dichoptic pipeline — each eye gets its own Viewport node, and we can swap shaders at runtime without touching native code. Meta Quest 2, 3, and Pro all share the same OpenXR runtime, so a single build covers the entire product line, reducing QA overhead and letting us iterate on the headset in‑house instead of juggling multiple SDKs.
The core of the therapy is dichoptic rendering: two separate textures, one per eye, each driven by a fragment shader that receives a uniform for real‑time contrast balancing. By adjusting the uniform each frame we can present a high‑contrast stimulus to the amblyopic eye while the fellow eye sees a lower‑contrast version, exactly matching the contrast‑delta prescribed by the clinician. The shader also handles the inter‑ocular suppression mask, ensuring that the brain receives the intended binocular rivalry without ghosting or latency spikes.
Gabor stimulus generation lives entirely in a procedural fragment shader. We expose spatial frequency, orientation, phase, and envelope size as uniform parameters, allowing the game logic to morph the pattern on the fly as the player progresses. Because the shader runs on the GPU, we can render dozens of Gabor patches per frame at 72 Hz (Quest 2) or 90 Hz (Quest 3/Pro) without taxing the CPU, leaving headroom for the physics‑based “coin‑collect” and “spike‑avoid” mechanics that keep the experience feeling like an arcade title.
The clinical protocol is mapped to four game stages. Stage 1 introduces high coin density and slow spike speed with a generous contrast delta, letting the patient learn the control scheme. Stage 2 reduces coin density and ramps spike speed while narrowing the contrast gap. Stage 3 adds dynamic orientation changes to the Gabor patches, training orientation‑specific cortical channels. Stage 4 pushes the contrast delta to the minimal clinically effective level and introduces randomized spatial frequencies, mimicking the variability of real‑world visual scenes. Each stage unlocks only after the telemetry confirms a minimum session count and a performance threshold, guaranteeing adherence to the prescribed dosage.
Adherence telemetry is stored locally on the headset — no cloud account required — using Godot’s built‑in JSON serialization. We log session start/end timestamps, total playtime, stage reached, contrast‑delta values, and a streak counter that resets only after a missed day. The data can be exported via the Quest’s file manager for clinician review. Validation of the dichoptic presentation was performed with a Borish Vectographic viewer: we captured the left‑ and right‑eye frames through the headset’s passthrough cameras, overlaid them in the viewer, and measured the resulting contrast ratio to within ±2 % of the shader‑defined target, confirming that the optical path introduces no measurable distortion.
We’ve open‑sourced the shader library and the OpenXR wrapper under MIT so other researchers can adapt the pipeline for different visual disorders. The next roadmap items include a mixed‑reality mode that leverages Quest 3’s color passthrough for ambient‑light adaptation, and a multiplayer “co‑op” mode where two patients can train together while the system tracks each eye independently. If you’re curious about the rendering pipeline, the Godot XR workflow, or the validation methodology, feel free to reach out — we love talking shop. Store: https://www.meta.com/en-gb/experiences/amblyopunch/1239507485902689/
Top comments (0)