Home▸Optics & Light▸Road Mirage Simulator (2D)

Road Mirage Simulator (2D)

Interactive 2D road-mirage simulator: heat a strip of asphalt and watch the thin layer of hot, low-refractive-index air above it bend light rays into an inferior mirage — an apparent puddle reflecting the sky and a distant car.

Optics & Light2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-3d-mirage-formation ↗ Open standalone

This 2D side-view simulator shows exactly how a hot road produces the classic "wet patch" inferior mirage: a thin layer of superheated air sits on the asphalt with a temperature — and refractive-index — gradient that shrinks toward the cooler air overhead, so a fan of shallow light rays coming from the sky and a distant car curve smoothly back up toward the eye instead of reaching the ground. Drag the asphalt-temperature slider to steepen or flatten that gradient and watch the shimmering puddle slide closer or fade away, drag the ambient-air slider to see the mirage weaken as the road-to-air contrast drops, and read off the apparent puddle distance against the car's true, fixed distance to see how the two never actually agree.

⚙ Under the hood

A 2D side-view companion to the 3D road-mirage scene: heat the asphalt and watch the thin layer of hot, low-index air above it bend a fan of shallow light rays back upward into a shimmering 'puddle', while a live readout compares the puddle's apparent distance to a distant car's fixed true distance.

inferior miragerefractiontemperature gradientSnell's lawroad heatatmospheric optics

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)