Willem Dafoe and Robert Pattinson star as sparring lighthouse keepers who drive each other mad in Robert Eggers's "The Lighthouse." MUST CREDIT: A24 Pictures Photo: A24 Films / A24 Pictures Photo: A24 Films / A24 Pictures

Early on in "The Lighthouse," opening Friday, a wild-eyed Willem Dafoe slaps Robert Pattinson across the face and, in an old-timey Downeast Maine accent, barks the indelible warning, "Bad luck to kill a seabird!"

The scene, which lands somewhere in the middle of the film's range of outlandishness, sets the tone for a hypnotic tale of lighthouse keepers who drive each other mad on a remote island in 1890s New England. In his second feature, director Robert Eggers embraces folksy horror similar to that of his 2016 debut, "The Witch," but this time employs language as darkly comedic as it is sinister and surreal.

A bushy-bearded Dafoe, 64, and mustachioed Pattinson, 33, form a striking pair whose differences, particularly when it comes to their acting techniques, only enhance the friction between their characters.

"The tension worked well on set," Eggers, 36, recalled over the phone. "Rob wanted to keep things buttoned up and locked up, and wanted to surprise me and Willem and himself on set. Willem was just 'Go-go-go-go-go Gadget' Willem all the time. But that's the character dynamic. As the director, you don't need to be a sadistic, Kubrickian manipulator to try to tease these tensions out - in fact, I just want everyone to be as comfortable and happy as they can be - but the camera sees the truth."

Loosely inspired by the real-life undoing of two Welsh men - an 1801 incident now referred to as "the tragedy of Smalls Lighthouse" - the film transports audiences to the past with its black-and-white imagery and 1.19:1 aspect ratio, shot through lenses designed in the early 20th century. Eggers worked with cinematographer Jarin Blaschke to fulfill the vision he had when his brother Max, with whom he wrote the script, mentioned years ago that he had been working on a ghost story set in a lighthouse.

There's a specific "kind of bleakness and extreme texture that is achieved only with black and white," Eggers said, explaining how the boxy aspect ratio, reminiscent of the early sound era, was helpful for framing tall objects like the tower and "also very good for meaty close-ups of two of the greatest faces that have ever been born."

Specificity of vision

Dafoe and Pattinson share an electric chemistry that carries the film, given that they're the only characters we ever encounter (with the exception of brief appearances by Valeriia Karaman's shrieking mermaid and a very aggressive seagull). Their path to doom is hinted at from the start, when Thomas Wake (Dafoe), a brutish man who has been on the rock for so long that he describes himself as "damn near married to this here light," informs his new apprentice, Ephraim Winslow (Pattinson), that the latter's predecessor died after raving about sirens and some sort of "enchantment" in the tower's light.

Both actors said they were cast in the two-hander after, beguiled by "The Witch," they reached out to Eggers and pledged to work with the rising indie director sometime in the near future.

Dafoe was especially drawn to the specificity of Eggers's vision, he said, as "one of the strongest things a director can do is make the world detailed and articulate and deep ... so when you enter it, it's much more easy to pretend." His character, Wake, delivers the bulk of the film's dialogue in long-winded speeches to Winslow, who conversely declares that he "ain't much for talkin'."

Eggers, whom Dafoe considers an "obsessive researcher," provided the actors with recordings and videos of lighthouse keepers to help them nail the accent Dafoe described as a mix of West Country English and "the Robert Newton kind of classic pirate." He likes to rehearse - a trait Eggers attributed to his background in theater - and in his spare time often invited Eggers over to the fisherman's shack he stayed in so he could run lines in the accent. (Eggers said he and his brother got so carried away writing dialogue like Wake's "faux-Shakespearean sea curse" that Dafoe asked them to cut it down.)

"It was mostly studying, reading, getting fake teeth made, growing a beard ... learning how to keep a clay pipe lit while I'm doing these big speeches," Dafoe said of his preparation for the role. "It's a swirl of experience that helps you enter the world, but you can't do it fully until you're really there."

Nova Scotia nightmares

"There," in this case, was Cape Forchu, a small fishing community along the southern coast of Nova Scotia with rough conditions that shaped the actors' performances in ways they couldn't predict. (A portion of the 35-day shoot also took place on soundstages in Halifax, a city about a three-hour drive away.)

"We chose that location because it was punishing and had terrible weather and would give us what we needed for the story, and it delivered on that," Eggers said of the high winds, pouring rain and slightly-above-freezing temperatures. Most of the film's weather events were real - a few milder days required rain machines - but "obviously, when you have waves crashing and it's Robert Pattinson trying to launch a ship, that's done in a controlled way so we don't lose Rob to a riptide."

Dafoe found the scenes where a shirtless Wake basks in the light at the top of the tower to be his most physically challenging, as "high-velocity winds aren't too good, particularly when you're naked and it's raining." Pattinson, asked about obstacles he faced, instead recalled his amusement while filming a scene in which Winslow is covered in all sorts of debris. (This is a tamer stop on the character's journey to insanity, which also includes him chugging kerosene and masturbating to a mermaid figurine.)

"I couldn't really see anything," he said. "Being blind, naked and having various people artistically arrange s--- all over your naked body, that was an unusual thing to do. Sort of a strange spa treatment."

Pattinson initially noticed the film's "strikingly strange script," which spends a good amount of time in an even-paced, dour zone and switches to a "turbocharged surrealist thing" in its final act. Winslow opens up as the film progresses (or spills his beans, as Wake puts it) and reveals himself to be a man on the run from his tragic past - not unlike other characters Pattinson has played in his recent indie films, including the space-traveling death row inmate from Claire Denis's "High Life."

"I find it's much more fun to play actors who don't know who they are," he explained. "It opens you up in how you play individual scenes, because you don't know how you're going to play it until you're there. ... My instinct is to go as dark as possible. But when another actor comes in, it feels like a really abstract energy you're playing against. It's always a little bit funnier and lighter.

"If somebody else played Willem's part in 'The Lighthouse,' it could be the most brutal, horrible drama. But there's something about the anarchic energy Willem brings. No matter how dark he is, there's always something pretty entertaining about him."

Critics have praised Dafoe and Pattinson, who seem perfectly suited to their roles in a film that is equal parts melodramatic and absurd - a casting success story Eggers said he cannot explain beyond calling it a hunch.

"They're both actors who like to take risks, who like to do strange, challenging work, who like to seek out auteurs and wannabe auteurs like myself and really stretch themselves," he said. "Certainly, they both have noses and cheekbones and teeth, and they almost look related sometimes, which is nice. On the cover of Esquire UK, they're like a long-lost sexy vampire father and son."