It’s November, and salmon are currently leaving the oceans and returning to the rivers where they were born. During these epic waterfall-leaping, bear-dodging migrations, their bodies change. Their color darkens and reddens. The males develop hooked jaws, and sometimes humps. The red muscles that are so useful for long-distance swimming are replaced by fast-acting white muscles that can power sprints and jumps. And one of the most dramatic changes, and perhaps the least obvious one, happens in their eyes.

In rivers, flecks of mud and algae shift the underwater light away from the clear blue of the ocean and towards the red end of the spectrum. The salmon compensate for this: A simple biochemical switch in their retinas gradually enhances their ability to see infrared light. The salmon effectively transform their eyes into night-vision goggles, so they can see further into the murky water where they’ll fight, mate, spawn, and die.

This trick revolves around a pair of molecules that form the building blocks of all animal eyes: a protein called an opsin and a partner chemical called a chromophore. These two embrace each other tightly, forming a joint unit called a visual pigment. When light hits the pigment, the chromophore absorbs its energy and rapidly snaps into a different shape. Its contortions force its opsin partner to transform, too. The two transformations trigger a series of chemical reactions that end in an electrical signal traveling to the brain.

That's what vision is.

There are different kinds of chromophores, and they’re usually based on the same chemical backbone—vitamin A—with a few subtle tweaks. These tweaks can make a huge difference. They alter the wavelength of light that the chromophores absorb best, and so change the colors that the visual pigments are most sensitive to.

In 1896, scientists first noticed that the visual pigments of freshwater fish are shifted towards the red end of the spectrum compared to their seafaring peers. In the 1930s, the American scientist George Wald showed that this difference depends entirely on the chromophore: Marine fish have vitamin A1 while freshwater fish have vitamin A2. (Wald was the person who discovered vitamin A’s role in vision, which earned him a Nobel Prize in 1967.)

In the 1950s and 60s, Wald and others showed the choice of chromophore isn’t set in stone. Fish like salmon and lampreys, which straddle the realms of salt and fresh water, can switch between A1 to A2 when they swim upstream, enhancing their ability to see infrared in waters where that ability matters.

Now, Jennifer Enright and Joseph Corbo from Washington University School of Medicine have finally shown how these animals do it.  

Enright and Corbo studied zebrafish, whose retinas normally contain vitamin A1, but can be shifted almost entirely to vitamin A2 with hormone treatments. They also looked at the eyes of American bullfrogs. Most amphibians switch from vitamins A2 to A1 when they metamorphose from aquatic tadpoles to land-living adults. But bullfrogs spend a lot of time at the water’s surface, with their eyes partly submerged. So they keep vitamin A2 in their upper retinas, which receive light coming up from the water below, while converting to A1 in lower parts that get light from the air above. They have bifocal night-vision goggles!

In both cases, Enright and Corbo found that the presence of vitamin A2 in the retina precisely coincides with the activity of one particular gene, known as Cyp27c1. They confirmed that the gene makes an enzyme that converts A1 into A2—and they showed that fish with mutated versions of the gene cannot carry out these transformations, and never gain the ability to see infrared.

If the same enzyme is at work in bullfrogs and zebrafish, which are distantly related, Corbo is positive that it acts similarly in salmon and lampreys. “We don't have the direct experimental evidence but we're very certain that's the case,” he says.

“The paper’s like the dénouement in a whodunit,” says Kristian Donner from the University of Helsinki. “The motive—more efficient use of the [red-shifted light] in lakes—has been known for 80 years, but the perpetrator has escaped discovery  until now.” Donner says that tracing the evolution of Cyp27c1 in different groups of animals might give us new clues about their lives.

Humans, for instance, have our own version of Cyp27c1. What are we doing with it? “We have no idea,” says Corbo. It looks like it might process vitamin A-related chemicals in our skin, “so maybe it confers some protection against ultraviolet light.”

It certainly doesn’t seem to be involved in vision. Although almost all birds and mammals have Cyp27c1 in their genomes, none of them have vitamin A2 or infrared-sensitive pigments in their retinas. Perhaps it’s because we’re warm-blooded, and vitamin A2 is less stable at consistently warm temperatures than A1. Or perhaps we just haven’t looked hard enough. “Maybe if someone looked at river dolphins, or mammals that live in these murky, red-shifted, aquatic environments, they might use vitamin A2,” says Corbo.

Cyp27c1 or not, the lack of vitamin A2 partly explains why the infrared part of the spectrum is invisible to us. A team of biohackers is trying to change that by crowdfunding an attempt to give themselves night vision, using foods supplemented with A2. The U.S. Navy tried the same thing during World War II and, despite some reportedly promising results, discontinued the experiment. But Corbo suspects that, even if they do succeed, will be a bit disappointed with the results. “They have a false impression of what kind of red-shift they're going to get,” he says. “It’d be a rather subtle enhancement.”

A more likely application for this work lies in the field of optogenetics—where scientists use opsins and chromophores to control the activity of neurons using flashes of light. The technique has revolutionized the field of neuroscience, and holds promise for treating diseases of the brain. The earliest optogenetic tools relied on blue light, and later yellow, both of which must be delivered to neurons using invasive optic fibers or implanted light sources. But a red- or infrared-sensitive pigment could be controlled from outside an animal, because these wavelengths of light can more easily penetrate through the body and brain.

Many scientists have been trying to find or find naturally occurring versions of these pigments, or to engineer their own. But Corbo thinks that he can make one more simply by starting with vitamin A1 and getting Cyp27c1 to convert it into A2. “It would be a creative strategy, and very complementary to our efforts to find new molecules from the wild with red-shifted properties,” says Ed Boyden from the Massachusetts Institute of Technology, one of the creators of optogenetics.