In “Transcendence” — out Friday and directed by Oscar-winning cinematographer Wally Pfister (“Inception,” “The Dark Knight”) — Johnny Depp plays Dr. Will Caster, an artificial-intelligence researcher who has spent his career trying to design a sentient computer that can hold, and even exceed, the world’s collective intelligence.

After he’s shot by antitechnology activists, his consciousness is uploaded to a computer network just before his body dies. A few years in, Depp-as-computer has developed the ability to heal people while networking their consciousness into his. As Will’s powers threaten to overwhelm the world, those on the outside debate whether he should be regarded as mankind’s savior — or its downfall.

While the film is science fiction, its technological milestones are based on real scientific theories and advances that could well happen, possibly in our lifetimes. Many scientists believe that the world’s aggregate computing intelligence will eventually eclipse the sum of all human knowledge. At that point, the world’s computers could become sentient, growing independent of us and operating on their own.

Here’s a look at how — and how soon — it could happen.

Brain copying

“The theories associated with the film say that when a strong artificial intelligence wakes up, it will quickly become more intelligent than a human being,” screenwriter Jack Paglen says, referring to a concept known as “the singularity.”

In the film, the path toward the singularity occurs not organically, via evolving computer intelligence, but by the intentional copying of Will’s brain.

Efforts toward making this a real-life possibility have accelerated of late. In February, President Obama announced a billion-dollar effort to map out the human brain — which could lead to cures for scores of diseases — and the European Union has a similar effort underway.

“There are people working on mapping the human brain right now,” says Pfister. “A neurobiologist at Caltech thinks we’ll be able to map a human brain and possibly duplicate it [in about] 30 years.”

Healing the body

Later in the film, as Will’s powers grow, he begins to pull off fantastic achievements, including giving a blind man sight, regenerating his own body and spreading his power to the water and the air.

This conjecture was influenced by nanotechnology, the field of manipulating matter at the scale of a nanometer, or one-billionth of a meter. (By comparison, a human hair is around 70,000-100,000 nanometers wide.)

“In some circles, nanotechnology is the holy grail,” says Paglen, “where we could have microscopic, networked machines that would be capable of miracles.”

The potential uses of, and implications for, nanotechnology are vast and widely debated, but many believe the effects could be life-changing.

“When I visited MIT,” says Pfister, “I visited a cancer research institute. They’re talking about the ability of nanotechnology to be injected inside a human body, travel immediately to a cancer cell, and deliver a payload of medicine directly to that cell, eliminating [the need to] poison the whole body with chemo.”

Superpowers and curing cancer

But what we see in the film goes beyond just healing, as the people that virtual Will has healed develop special powers. One lifts an 800-pound metal antenna with ease; another jumps, from a standing position, from the ground right onto the roof of a building.

While this is a bit of creative conjecture, nanotechnology brings our conversion to superhumans into the realm of possibility.

“There’s the idea that nanotechnology could help repair the muscle fibers in your arm, then make your arm much stronger, because microscopic machines could go to the tissue in your bicep and repair it, and accelerate the natural process,” says Paglen.

“Nanotechnology could help us live longer, move faster and be stronger. It can possibly cure cancer, and help with all human ailments.”

Playing god

“One of [science-fiction author] Arthur C. Clarke’s laws is that any sufficiently advanced technology is indistinguishable from magic. That very quickly would become the case if this happened, because this artificial intelligence would be evolving technologies that we do not understand, and it would be capable of miracles by that definition,” says Paglen. “There are a lot of people who are deeply concerned about the possibility of this, because ultimately it would mean the emergence of some godlike being. That’s something I was very conscious of in terms of the metaphor of this story — how would the world respond to a living god?”

The filmmakers hope audiences will join them in pondering the questions raised by these inevitable technological leaps — not just about the nature of a

human-turned-technological-being, but the nature of the world that would result from this simultaneously frightening and thrilling possibility.

“One of the questions I’m really interested in is, ‘How will society respond if and when this happens?’ ” says Paglen. “Will we keep our composure and humanity in the face of something so inhuman?”