Director and writer M. Night Shyamalan's latest movie, the superhero-mystery film "Glass," is expected to top the Hollywood box office as it hits theaters this weekend.
If that is indeed the case, then the movie, which is a follow-up to previous Shyamalan films "Split" (2017) and "Unbreakable" (2000), would represent the latest chapter in the director's own epic comeback story.
Much like many of his films, Shyamalan's career turnaround has featured its share of wild twists and turns, starting with his 1999 breakout as the writer and director of the massively popular supernatural thriller "The Sixth Sense," which made over $670 million at the global box office and earned Shyamalan an Academy Award nomination for his work as director.
From there, Shyamalan released multiple popular movies in the early 2000s: "Unbreakable," "Signs" and "The Village."
But a series of poorly-reviewed films (including 2006's "Lady in the Water" and 2008's "The Happening") followed by a pair of complete financial flops (2010's "The Last Airbender" and 2013's "After Earth" with Will Smith) left Shyamalan's career in serious jeopardy.
(Mega-star actor Will Smith said "After Earth" was "the most painful failure of my career" and Entertainment Weekly wrote that Shyamalan had "lost credibility with audiences" after that film. The movie had a budget of $130 million and grossed only $60 million domestically, though it made more overseas, according to Box Office Mojo.)
In a commencement speech at Drexel University in 2018, Shyamalan told graduates that he experienced a great deal of self-doubt in the period that followed his string of box-office failures. Describing his thinking at the time, he said in his speech: "I find myself questioning myself, and every thought that comes out of my head," he said. "The world of my industry decides I have no worth. I am a cautionary tale. A person who got lucky for a time but revealed himself to be a sham."
With his reputation as a writer-director in shambles, Shyamalan realized that he would have to try and tune out the rampant criticism by listening to his gut and making low-budget, independent horror movie similar to the suspenseful films that helped launch his career.
"This was a time when nobody was calling, nobody wanted to make a film with me," Shyamalan says in the speech. That meant he would have to finance the film himself, so he took out a $5 million loan, putting up his family's house as collateral.
Shyamalan finished a rough cut of the movie and showed it to every Hollywood studio that would meet with him. They all passed. At that point, he says, "I am on the verge of financial collapse. I do not believe in myself."
Despite his disappointment, Shyamalan convinced himself to keep working on his self-financed movie. "I went into the editing room [and] I just made one scene better, just one moment better," Shyamalan says in his speech. He kept working to improve the movie — "I made another moment better and another moment better," he says — and those incremental successes helped him shrug off the weight of his disappointment and Hollywood's criticism of his work.
"I just stopped thinking about selling the movie, I stopped thinking about what was going to happen to me. And, I just got addicted to this feeling of making that next thing better," he says.
Shyamalan showed the edited version of his film to Universal Pictures and the studio bought the rights to distribute the movie and horror film powerhouse Jason Blum's Blumhouse Productions ( "Get Out," "The Purge") signed on as the producer. The movie, a found footage horror film called "The Visit," went on to gross nearly $100 million (on a production budget of just $5 million) while receiving mostly positive reviews from critics.
Shyamalan took the money he made from "The Visit" and self-financed his next movie, 2017's "Split," which earned a number of rave reviews and grossed $278 million worldwide on a production budget of just $9 million.
Now, he's releasing "Glass" and industry trackers expect the new film to clear more than $50 million over the holiday weekend — an opening bow that could put it on pace to match last year's popular horror film "A Quiet Place," which grossed over $340 million in total.
Shyamalan believes now that what spurred his career comeback was simply his realization that there are only so many things that each person has control over. For instance, he could not control the reactions of critics, audiences and Hollywood executives to his work, but he could control how hard he worked on his next project and how focused he was on making it better, bit by bit.
"A person who concentrates on what they have power over becomes unlimited in their ability to manifest what they want in the world," Shyamalan told Drexel graduates in his commencement speech.
Disclosure: NBCUniversal is the parent company of both Universal Pictures and CNBC.
Like this story? Subscribe to CNBC Make It on YouTube!