Building AmblyoPunch: A Meta Quest VR Game for Dichoptic Amblyopia Training Context: Europe's summer of fire (NYT) shows how precision interventions (controlled burns) beat brute force. In vision rehab, the 'patch' is brute force. We built AmblyoPunch to bring precision: a Unity/Quest app that renders Gabor-pattern stimuli at independently controlled contrasts per eye across a 4-stage curriculum.
The project began with a clear design goal: replace the traditional occlusion patch with a binocular, game‑like environment that can modulate stimulus strength for each eye in real time. Using Unity’s Universal Render Pipeline (URP) we created two dedicated camera rigs — one for the left eye, one for the right — each receiving its own texture array. This stereoscopic separation allows the shader to draw Gabor‑pattern “coins” and background elements at distinct contrast levels without any post‑process blending that could leak signal between eyes.
A ScriptableObject‑driven contrast ladder defines the four curriculum stages. Stage 1 presents the fellow eye at near‑maximum contrast while the amblyopic eye receives a low‑contrast version of the same Gabor set. Stage 2 raises the amblyopic contrast by a fixed step, Stage 3 narrows the gap further, and Stage 4 equalises both eyes. Because the ladder lives in a ScriptableObject, clinicians or researchers can adjust step size, number of stages, or even add custom stages without touching code, and the changes persist across builds.
Gabor generation runs on a compute shader each frame. The shader writes orientation, spatial frequency, and phase parameters into render textures that feed the eye‑specific material instances. This procedural approach eliminates the need for baked asset libraries, reduces build size, and guarantees that every session can present a fresh, pseudo‑random stimulus set — important for preventing memorisation effects.
Interaction relies on the Quest’s native hand‑tracking pipeline with a controller fallback. Punch detection uses a sphere‑cast originating from the tracked fist joint; when the cast intersects a Gabor coin the hit registers, the coin disappears, and the contrast ladder may advance depending on the current stage. Spike‑dodge mechanics read the headset pose directly, requiring the user to lean or step aside, which adds a vestibular component and encourages natural head movements. Both input paths are abstracted behind a single InputManager, so switching between hand‑tracking and controller modes is seamless.
Data collection is built around privacy‑first local storage. Each session writes a JSON log containing the active contrast level per eye, hit/miss counts, reaction times, and a suppression‑check flag that records whether the fellow‑eye stimulus was detected during a catch trial. The log files sit in the app’s persistent data folder; an optional “Export” button packages them into a ZIP that the user can transfer via the Quest’s file manager or share through a secure cloud link. No telemetry leaves the device without explicit user consent.
Performance profiling on Quest 2 and Quest 3 shows a stable 72 fps with the compute shader active, thanks to the lightweight Gabor math and the URP’s single‑pass stereo rendering. Memory usage stays under 150 MB, leaving headroom for future modules such as adaptive difficulty based on psychometric fitting or a multiplayer “duel” mode where two users train simultaneously on separate headsets.
The development workflow leveraged Unity’s Addressable Asset System for the few static assets (UI panels, sound cues) while keeping the core stimulus pipeline entirely code‑driven. Continuous integration runs automated unit tests on the contrast ladder logic and integration tests that simulate a full 10‑minute session on a headless Quest emulator, catching regressions early.
User‑experience testing with a small cohort of vision‑science researchers highlighted the importance of clear visual feedback when a punch lands. We added a brief particle burst and a subtle haptic pulse on the controller, both configurable via the same ScriptableObject that governs contrast steps. This keeps the feedback loop tight without overwhelming the visual stimulus.
Future roadmap items include a web‑based dashboard for clinicians to visualise exported logs, an experiment‑builder UI that lets researchers define custom contrast schedules, and integration with the OpenXR eye‑tracking extension (when available on Quest) to verify fixation compliance during each trial. All extensions will preserve the current local‑first data model and the ScriptableObject‑centric configuration philosophy.
https://www.meta.com/en-gb/experiences/amblyopunch/1239507485902689/
Top comments (0)