Kristen Stewart, Ben Foster and Tom Glynn-Carney have signed on to star in an untitled drama about Beat Generation writer William S. Burroughs with Foster making his directorial debut on the project.

The film explores an unusual love triangle between Burroughs, portrayed by Foster; his charismatic, common-law muse, Joan Vollmer, played by Stewart; and a straight-laced American expatriate portrayed Glynn-Carney, who upends their lives to the extreme. Foster will direct from a script he’s co-written with Oren Moverman, based on Burroughs’ early works.

Burroughs, a heroin addict, killed Vollmer in a 1951 shooting accident in Mexico City. He achieved success two years later with his first novel, “Junkie.” He’s best known for his 1959 novel “Naked Lunch.”

Celluloid Dreams has acquired the international sales rights to the project and will be selling it at the Cannes Film Festival, which opens May 14. UTA Independent Film Group will handle sales for the United States and Canada.

Stewart, who gained fame for the “Twilight” movies, stars in the forthcoming “Charlie’s Angels” reboot, as well as Amazon’s “Against All Enemies.” She starred in Olivier Assayas’ “Clouds of Sils Maria” and won awards from the National Society of Film Critics, New York Film Critics Circle and Boston Society of Film Critics Awards for best supporting actress. Stewart also starred in the 2012 Beat Generation movie “On the Road,” directed by Walter Salles.

Foster previously collaborated with Moverman on “The Messenger” and “Rampart,” which Foster also produced with Ken Kao. Foster won a Spirit Award for “Hell or High Water” and is currently executive producing and starring in Barry Levinson’s boxing biopic “Harry Haft.” Glynn-Carney broke out as one of the leads in Christopher Nolan’s “Dunkirk.”

Moverman is also producing through his Sight Unseen production company along with Olive Productions’ Wren Arthur and Waypoint’s Kao. Steve Buscemi is serving as an executive producer through Olive Productions.

“We have found the perfect partners in Hengameh Panahi and Charlotte Mickie of Celluloid Dreams,” Foster said. “We are delighted to align our film with their formidable taste and reputation to celebrate this unique, untold love story. Our film is kind of anti-Beat. We meet our star-crossed lovers in New York City, head to the Texas border, roar through Mexico City’s underbelly, and end up in the Amazon jungle. This film is about love, sex and self-discovery in all of its lush, dark and often hilarious complexity.”

Foster is repped by UTA, Stewart is with Gersh and Glynn-Carney is with Independent Talent Group and UTA.