Unity prototypes demonstrating image-space pre-distortion techniques used in XR display pipelines, focusing on:
- Barrel / Pincushion Distortion
- Chromatic aberration
The goal of this project is to show how virtual content can be pre-distorted in software so that, after optical distortion, the perceived image appears correct.
All parameters are synthetic and chosen to make the effects clearly visible.
This repository demonstrates the logic of pre-distortion and correction, both of which are simulated
Display pipeline: Rendered image → software pre-distortion → optical distortion → perceived image The goal of pre-distortion is to ensure that, after optical distortion, the perceived image appears geometrically and chromatically correct.
- Barrel and Pincushion distortions and their inverse pre-distortion correction
- Chromatic aberration and its inverse pre-distortion correction
- Unity-based implementation using shaders and simple runtime controls
-
Scene 1: Barrel/Pincushion Distortion Pipeline
Barrel and pincushion distortion applied to a checkerboard pattern, with toggleable pre-distortion correction. -
Scene 2: Chromatic Aberration Pipeline
Chromatic aberration applied to a Siemens sinusoidal star pattern, with toggleable pre-distortion correction.
Each scene allows visual comparison between:
- original content
- optics distortion only
- pre-distortion only
- pre-distortion + optics distortion (corrected result)
Brown’s simplified Forward radial transform:
Brown’s simplified Inverse radial transform:
Reference Image |
Simulated Barrel Distortion (Low) |
Pre-Corrected Image |
Distorted Image appears close to reference image |
Reference Image |
Simulated Barrel Distortion (High) |
Pre-Corrected Image |
Distorted Image appears close to reference image |
Reference Image |
Simulated Pincushion Distortion (Low) |
Pre-Corrected Image |
Distorted Image appears close to reference image |
Reference Image |
Simulated Pincushion Distortion (High) |
Pre-Corrected Image |
Distorted Image appears close to reference image |
Reference Image |
Simulated CA (Low) |
Pre-Corrected Image |
Distorted Image appears close to reference image |
Reference Image |
Simulated CA (High) |
Pre-Corrected Image |
Distorted Image appears close to reference image |
- Open the Unity project.
- Load a scene from the
Scenes/folder. - Click on the Main Camera in the inspector pannel.
- Use the exposed toggles and sliders to inspect distortion and correction behavior.
- In Unity, the "games" tab is used to see the effect of modifying the toggles/sliders.




















