The Materioptikon was an experimental device invented by Bill Brooks.
The machine could give subjects extrasensory perception, but only for a while. Short on test subjects, he struck a deal with Stryker's Island Penitentiary to use inmates. John Dee was the most promising one, but he wanted more than the doctor thought wise. During a prison break, Dee knocked Brooks unconscious and activated the machine. The overdose in radiation gave him the power to enter and alter people's dreams.
In DC Comics, the Materioptikon is not a machine, but a gemstone, also called the Dreamstone. It was originally a creation of Dee himself, until Neil Gaiman retconned it for his Sandman series with Vertigo. In this version, Dream of the Endless created the stone, and it was stolen from him by Dee's mother, who gave it to her son so he could escape Arkham Asylum.