The Scottish scientist David Brewster was one of those 19th-century characters with no real equivalent today. An ordained minister in the Church of Scotland, he took an early interest in astronomy and became for a time one of the world’s leading experts on the science of optics. He also harbored a great fondness for popular amusements, and at some point in the early part of the century, he began frequenting a theatrical horror show in the West End of London called the Phantasmagoria. He went in part as a debunker, a skeptic hoping to reveal the secret craft behind the spectacle. But he also sensed that something profound was lurking in the trickery. He suspected that the showmen were exploiting some intrinsic quirks in the human sensory system — perhaps, he hoped, rendering them more intelligible to the scientist. Brewster called the world of scientifically produced illusion “natural magic.”

The Phantasmagoria came to London in 1801, after a decade or two of development in Germany and France. Relying heavily on ghostly magic-lantern projections, the show submerged its patrons in a multisensory vault of dread and illusion — in contemporary terms, a cross between the immersive theater of “Sleep No More” and Disney’s Haunted Mansion. Shortly after its arrival, the success of the Phantasmagoria and a handful of similar shows set off a kind of entertainment version of the Cambrian explosion. Bizarre new species of illusion proliferated across the West End. The names themselves, with their strange Greek neologisms, suggest just how far the language strained to tout the novelty of the experiences. According to “The Shows of London,” by Richard Altick, a visitor to the city in the early to mid-1800s could enjoy a “novel mechanical and pictorial exhibition” called the Akolouthorama; a rival spook show called the Phantascopia; an exhibition called the Spectrographia, which promised “traditionary ghost work!”; an influential mechanical exhibition dubbed the Eidophusikon; and the Panstereomachia, “a picto-mechanical representation,” in the words of The Times of London.

Brewster himself was something of a natural magician. Right around the period he was studying the Phantasmagoria, he invented the kaleidoscope, which for a few years was the PlayStation of the late Georgian era. (Brewster barely made a penny from the device, as imitators quickly flooded the market with clones of his original idea.) Decades later, he invented the lenticular stereoscope, a hand-held technology that fools the eye into perceiving two distinct flat images as a single 3-D scene. This time around, Brewster managed to build a successful business selling his contraption, branded as a “Brewster Stereoscope.” Queen Victoria famously marveled at one during the Great Exhibition of 1851. Oliver Wendell Holmes published a paean to the stereoscope in The Atlantic, rhapsodizing over the new technology with an enthusiasm that wouldn’t have been out of place in an early issue of Mondo 2000 or Wired:

Oh, infinite volumes of poems that I treasure in this small library of glass and pasteboard! I creep over the vast features of Rameses, on the face of his rockhewn Nubian temple; I scale the huge mountain-crystal that calls itself the Pyramid of Cheops. I pace the length of the three Titanic stones of the wall of Baalbec — mightiest masses of quarried rock that man has lifted into the air. ...

By the dawn of the 20th century, almost every species in the 19th-century genus of illusion was wiped off the map by a new form of “natural magic”: the cinema. The stereoscope, too, withered in the public imagination. (It lingered on as a child’s toy in the 20th century through the cheap plastic View-Master devices many of us enjoyed in grade school.) But then something strange happened: After a century of irrelevance, Brewster’s idea — putting stereoscopic goggles over your eyes to fool your mind into thinking you are gazing out on a three-dimensional world — turned out to have a second life.

This is how, a few months ago, I found myself holding an original 19th-century wooden stereoscope. I was visiting the headquarters of RYOT, a Los Angeles-based media company that produces stories in virtual reality, and that maintains a collection of stereograms from the heyday of the device. It’s easy to see why, because the family resemblance to today’s V.R. goggles is unmistakable; in fact, the stereoscope I held was literally forward-compatible with today’s smartphones. RYOT’s chief executive and co-founder, Bryn Mooser, slid an iPhone into the slot behind the lenses, and as I pulled the contraption up to my eyes, I was transported to the banks of the Ganges River. It felt like a moment from some steampunk novel: a Victorian contraption conjuring a world through natural magic of a distinctly digital kind.