In 2015, after wrapping principal photography on his first big-budget Hollywood movie, a remake of the Disney children’s classic Pete’s Dragon, David Lowery came home to Dallas. It was meant to be a brief stop-over to pack up his house and move to Los Angeles to begin editing. After years of struggle on the fringes of the film industry, Lowery had finally hit the big time, and the path ahead seemed obvious: Move to Hollywood and make the most of his moment in the sun.

But his gut was telling him otherwise. “The whole process of finding a place in LA and packing up Dallas was psychologically unsettling to me,” says Lowery, 36, who grew up in Irving. “I felt like I was letting go of something very important. My wife was excited to get out of the house. I’d whine about it, and she’d roll her eyes. As a result, she was the one who did all the work of packing up.”

Over the holidays, Lowery’s foot-dragging led to a blow-up with his wife, fellow Dallas-area native Augustine Frizzell. “We had a pretty big disagreement,” Lowery says. “It was one of the more definitive arguments we’ve had in our relationship. I remember telling her, ‘This feels like a scene from a movie.’”

Viewers will recognize a similar argument onscreen in the early scenes of Lowery’s new film, A Ghost Story, starring Casey Affleck and Rooney Mara, which opens July 7. The film’s autobiographical aspect ends there, however. Soon after trying to talk Mara out of a big move, Affleck’s character dies. He spends the rest of the film under a white bedsheet, sullenly haunting the house they’d shared. When Mara finally leaves, the film sticks with Affleck’s ghost, who becomes increasingly attached to—and imprisoned by—the house he inhabits.

The latter half of A Ghost Story strikes a profound spiritual tone not often seen in American movies, and especially not in haunted house films. Lowery chalks it up in part to his childhood. His father, Mark Lowery, is a professor of theology at the University of Dallas. The younger Lowery has long since rejected the tenets of his father’s Roman Catholicism, but he admits that he still believes in ghosts. “The idea of there being more to this world than what we see was huge part of my upbringing,” he says. “There was a lot of discussion of ghosts and whether they’re souls in purgatory or not.”

Idiosyncratic and unpredictably paced, concerned with the passage of time on both an intimate and geological scale, A Ghost Story is a world apart from traditional Hollywood genre fare, but it does bear the influence of Texas-based indie film giants like Richard Linklater and Terrence Malick. It debuted to a buzzy reception at the Sundance Film Festival in January and is being distributed by A24, which handled last year’s indie Oscar-winner Moonlight.

With the growing sense that a dynamic, Hollywood-outsider career path might be possible for him in Texas, Lowery’s disagreement with his wife has mostly resolved in his favor. Though the two travel frequently to LA, they have put down roots in Dallas. “I’ll be there awhile,” Lowery says.

Lowery admits that the quirks that A Ghost Story’s protagonist embodies—a desperate hunger for stability and an intense nostalgia fixated on material things—are grotesque, unflattering reflections of his own stubborn refusal to move on from Dallas. “I am a homebody,” he says. “I like familiarity. There’s something comforting about having a place to go back to that feels like the back of your hand.”

But, Lowery stresses, the choice to remain in Dallas is also deeply practical. “I spent a great deal of my youth wanting to leave Dallas and go to New York or LA,” he says. “At a certain point, that ceased to be important to me. What was important to me instead was making things that felt like personal expression. I had the means to do that in Dallas. There’s a great deal of allure about moving to where all the activity is when you’re not actually making things. But once you’re actually making things, the pressure of that environment is counterproductive to making good work.”

Lowery’s next dream is to find a way to make bigger films without leaving home. His upcoming project, a true-story bank-robber film starring Robert Redford, takes place largely in Fort Worth, but Lowery was forced to shoot it in Ohio because the Texas Film Commission’s incentives were too paltry. “Right now, you can’t get a green light without going somewhere else,” he says. “I hope in the future I can make movies in Texas that aren’t just hundred-and-fifty-thousand-dollar movies like A Ghost Story.”

As with so much about filmmaking, building an interesting career without having to leave home will be, for Lowery, a matter of imagination, of seeing what other people can’t see. “There are sound stages, equipment, actors, yet it never feels like there’s a film industry in Dallas,” Lowery says. “It’s kind of like a secret, ghost industry. Once you realize it’s there, you can utilize it and make great things.”