When British director Steve McQueen began developing his second feature film, he found that London wanted no part of its controversial subject matter. “Shame,” opening Friday, follows a man in the grip of sexual addiction. Step One for McQueen was to do on-the-ground research, which proved to be a touchy matter.

“No one would speak to us,” McQueen says of the experts and addicts he tried to interview. “Everyone thought we were with the media, even though we said we were making a feature film.” So McQueen moved the production to New York, where he took advantage of a more open attitude toward discussing such proclivities.

The main character of Brandon, played by Irish-German actor Michael Fassbender, “has access to anything you want 24 hours a day,” McQueen explains. “He has the keys to New York: He’s attractive, has a great job, great apartment. But what does he do? He puts himself into a prison with his sexual activities.”

This film marks the second time McQueen and Fassbender

have worked together, with both productions proving physically demanding for the actor. For 2008’s “Hunger,” Fassbender lost more than 60 pounds to portray IRA leader Bobby Sands, who staged a hunger strike while in prison in the early 1980s.

“Shame” proved equally challenging, though in a very different way. Fassbender appears in every scene of the NC-17-rated movie — which features numerous sex scenes, lots of full-frontal nudity and some risky behavior by Brandon, including hiring call girls and obsessively masturbating at work.

Fassbender drew from his background in pantomime to communicate such desperate desires. “It’s always about the physicality of the character,” he says. “How does he express what’s going on inside of him physically? You have to show the audience what this condition is all about and how much it is smothering him.”

As the movie opens to a wide audience, McQueen says he is still trying to figure out what his film says about the solitariness of our digitally driven world. “I’ve been thinking about it a lot, and I think it’s very indicative of how we are now. We live more in our heads than anywhere else.”