In a genius stroke of Scottish themed counterprogramming, we find two very different Edinburgh based films to choose between at the box office this week. One, Sunshine on Leith, is a musical based on the songs of The Proclaimers and promises mass sing alongs of 'I’m Gonna Be (500 Miles)'. The other is Filth, based on Irvine Welsh’s 1993 novel of the same name. Welsh may have been born in Leith but its famed sunshine doesn’t make it into his work.

Filth stars James McAvoy as Bruce Robertson, a morally bankrupt, mentally unstable, policeman. The film takes place in the run up to the Christmas season as Robertson eyes up a promotion and attempts to sabotage his rivals’ chances of beating him to it. As his mental state deteriorates, no thanks to the prodigious amount of drugs and alcohol he consumes, he begins to unravel. Plagued by hallucinations and visions of his past, he tries to win the promotion and reconnect with his estranged wife.

Director/screenwriter Jon S. Baird’s take on the picaresque novel is visually vibrant, taking full advantage of Robertson’s mental state to fill the screen with his hallucinations, fantasies and daydreams. For the most part, these joyously deranged asides, with their enthusiastic disregard for good taste and political correctness, are funny and raucous.

It’s not all successful though; as Bruce’s mental state begins to deteriorate, so too does the narrative. The brutal murder that begins the film and even the pursuit of the promotion are ultimately forgotten about in the delirium. The film becomes a collection of vignettes ranging from the kitschy (David Soul as a singing taxi-man) to the disturbing. This feeling of disconnectedness means that attempts at pathos (Bruce’s hallucinations of his dead brother) and the emotional climax of the film (with its clunky cover of Radiohead’s 'Creep') end up having little emotional impact.

Though Filth undoubtedly has its failures, they are noble ones. As a whole, the film has a gloriously debauched bravery, not least in the performance of McAvoy, who throws himself at the role like a man possessed. He maintains a staggering level of commitment and the usually fresh faced actor transforms himself into something repellent. Add to this an impressive supporting cast (Eddie Marsan and Shirley Henderson both excel) and the result is a disturbing but diverting piece of trash.