James McAvoy plays a corrupt detective in the film Filth.

James McAvoy plays a corrupt detective in the film Filth.

James McAvoy explores the depths of corruption and depravity in a new trailer for the dark comedy “Filth.” The movie is based on a novel by Irvine Welsh, whose book “Trainspotting,” became a cult classic after it was turned into a movie in 1996.

Welsh followed up with “Filth.” The 1998 novel focuses on the life of a corrupt police detective serving in Edinburgh’s “Lothian Constabulary.”

McAvoy plays Bruce Robertson, whose bigotry and corruption know no bounds. His life revolves around cocaine and alcohol binges, sexually abusive relationships, and compulsive junk food binging.

He also schemes against his colleagues in hopes of landing a promotion, while dodging as many of his tedious official duties as possible.

His cravings for violence, drugs, sex, and pornography are seemingly insatiable, while his racism, sectarianism and misogyny is blatant and unabashed, according to the book. As his mental health deteriorates, he’s diagnosed with a bipolar disorder, exacerbated by drug addiction.

The movie takes a bizarre twist when the murderer in the homicide case he’s working on is finally revealed.

Imogen Poots, Jamie Bell, Joanne Froggatt, Eddie Marsan and Jim Broadbent also co-star. The film will be released in the UK in September. It doesn’t have a U.S. release date at the moment.

Check out the clip below and let us know your thoughts. Warning some scenes are graphic.