Robert Kenner’s “Merchants of Doubt” pulls back the curtain on the illusionists deployed by oil, gas and tobacco companies to use pseudo-science and spin to create an alternate reality in which cigarettes and gas guzzlers are our friends.

“The American public believes in science unless it’s inconvenient,” Kenner said during a dinner for the film shortly before his new documentary premiered at the Toronto Film Festival on Tuesday.

The film is a mordantly funny indictment of this army of well-heeled prevaricators. Inspired by the book of the same name by Naomi Oreskes and Erik M. Conway, Kenner benefits by being able to show these spin-masters in their element, as they thrust, parry, and smile, always smile, on cable news programs.

Global warming may be real, and it may not be, we need more time to study it, they good-naturedly reassure viewers. It’s not clear that tobacco kills, they offer up. The planet isn’t it heating up, it’s getting colder, is another eye-popping piece of analysis.

Often their message comes tarted up with the kinds of graphs and spreadsheets used by legitimate, peer-reviewed scientific journals, all of it arriving from very official sounding names such as the Heartland Institute and the Marshall Institute.

“If you’re producing oil or coal you want to find reasons to keep producing it,” said Kenner during a post-screening Q&A at the TIFF Lightbox Theater.

Kenner is best known for his Oscar-nominated documentary “Food Inc.,” which took a chisel to the myths spread by agribusinesses about food safety. Participant Media and Sony Pictures Classics are backing “Merchants of Doubt” and the film should play to the crowd that made “An Inconvenient Truth” a hit.

That film galvanized the energy lobby to fight back, Kenner said. As part of their attack plan, climate deniers targeted the scientists themselves, something that one of them, Marc Morano, gleefully admits to Kenner, saying, “We mocked and ridiculed [them].”

They found an unwitting ally in media companies such as CNN and New York Times, who — bound by the strictures of journalistic balance — gave too much weight to views that were not supported by science.

Kenner said, despite himself, he found men like Morano charming, but was horrified by the damage they were doing to national debate. Their natural affinity for the klieg lights allowed him to convince them to participate in his project despite its subject matter.

“Many of them like to be seen on camera,” he noted.