When Trainspotting arrived 17 years ago, it changed the face of British cinema, giving birth to the Cool Britannia era of film-making. Director Danny Boyle and his cast received their share of the credit, but it was Irvine Welsh's unmistakable voice that proved the true revelation. Though still early in his career, Welsh had established himself as a challenging literary figure, the unrelenting mediator of Britain's cultural underbelly.
Now, at 54 years old, Welsh is one of our most revered writers. And putting aside the relatively unremarkable adaptations of his novella The Undefeated and the short story anthology The Acid House, it's almost unbelievable that it's taken this long for another of his full-length novels to make it to the big screen. It's not for the want of trying, though: Filth, adapted from Welsh's 1998 novel, languished in development hell for the best part of 15 years, with the project passing through the hands of numerous producers. As far as Welsh is concerned, it was worth the wait.
"People who are interested in cinema will be arguing this point for years to come." he says. "What's better, Trainspotting or Filth?"
Welsh might not be asking this question if Filth had been successfully rushed into production back in 1998. The film would likely have been resembled Trainspotting, both aesthetically and tonally, in an effort to strike gold twice in as many years.
Fortunately, the 2013 version of Filth has the freedom to do things on its own terms, which is does to the extreme; it's a surreal and vivid journey into the corruptible mind of its lead character, Detective Sergeant Bruce Robertson (James McAvoy), the Edinburgh copper whose personal and professional problems find him losing his grip on reality.
It's what Welsh correctly describes as "an ultra-dark, head-fucking film". And though Filth is a very different beast to Trainspotting, they remain equally credible and faithful interpretations of the Welsh's writing.
"I can smell the books on both films," says Welsh. "They've kept the essence and respect for the material, but they've got a very different cinematic structure. The first 20 minutes of Filth are like Trainspotting's style… then it completely moves into this area of a Greek or Shakespearean tragedy."
It is, of course, the "essence" that's key to a successful novel-to-film adaptation, not complete fidelity to the original story (no matter how much the purists cry heresy). To make Filth work, it needed a film-maker who understood what was at the core of the book. It also needed Welsh to step away and allow the adaptation process to develop on its own. Enter director-screenwriter Jon S Baird, who impressed Welsh with his inventive script and passion for the project.
"I adapted my own book The Acid House and it wasn't very good," Welsh says. "You've got to have a bit of distance. I could tear apart anybody else's book but it's hard to do it to my own. You need to get somebody in who's really going to try and find the cinematic heart to it. Sometimes you have to throw away stuff… sometimes really good stuff. I remember [Trainspotting screenwriter] John Hodge telling me he had to throw away some of his favourite scenes because the narrative thread just wasn't working. But on this movie Jon has made some good choices."
There was little chance of Filth arriving on-screen completely intact. This is mostly thanks to the book's defining feature: a tapeworm that grows inside of DS Robertson and occasionally interrupts the story, posing existential questions and acting as Robertson's conscience. It's the kind of sinister but strangely comic element that Welsh's stories are known for; it's also something that works perfectly for a novel but is near impossible to replicate in live action. It's this kind of thing that gives a novel a reputation as "un-filmable". But Baird's cinematic vision for the book succeeds in reinventing the material, adopting an alternative means of peering into Robertson's damaged psyche. Forget the details, what's important is that both versions share something deeper. And whatever that is, it's very disturbing indeed.
Though Filth may be way out there – needless to say, Welsh is a writer who has enormous fun exploring the darkest recesses of human capability – there's also something frighteningly familiar and real about the story. And 15 years after its publication, Filth's political edge still rings very true.
"At Edinburgh council there a lot of guys like Bruce that were the system," says Welsh. "The council had changed from being this old bureaucracy into this big equal opportunities 'right on' place, but they were working with these dinosaurs who were still wandering around in this kind of culture. I thought it would be great to do something about that, but then the council's kind of boring – if you've got a fucked-up council official, you might not get your rubbish taken away on time. But if you've got a corrupt cop it's much more interesting."
Indeed, Bruce is one of the most fascinating police officers to appear on film, in a different league to scores of bent coppers we've seen before. Though undeniably abhorrent, like those around him Robertson is a victim of his own psychological deterioration, made all the more human by James McAvoy's inspired performance.
"I made him totally dissident," says Welsh. "His beliefs and actions are out of synch, and he has a full mental breakdown as a result of all that. What's interesting about Bruce Robertson is that he's in a strict bureaucracy and functions on certain rules, but he's this fucked-up, transgressive guy. He has more enemies inside the police force than he has outside of it… He wants to destroy them all. The people he's got his sights on are the people in the office. He doesn't care about the people selling drugs in the street. That sense of the enemy within, the whole sabotage thing, that transgression is always appealing."
It won't be another 15 years before an Irvine Welsh is adapted. Porno, the long anticipated sequel to Trainspotting, has already been announced for production. It's also likely that Filth will spark something of a resurgence of interest in Welsh's back catalogue. So what else can we expect to see on the big screen?
"We'll see what happens," he says. "The way it is these days, you can't just have a book or film or TV series, you've got to have the lot."
'Filth' is released on 4 October