Park City • One of the scariest, most mind-warping movies at this year’s Sundance Film Festival premiered in the wee small hours Sunday — and it was all filmed in Utah.

“Hereditary,” a dark story of family grief that takes a twisted turn into the supernatural, had the audience at Park City’s Egyptian Theatre gasping at the jump scares and talking about its dread-filled tone on the shuttle buses.

“It doesn’t feel like we’ve been gone very long,” writer-director Ari Aster said. The production wrapped shooting at the end of June, filming on location in Park City and Salt Lake City, and in the Utah Film Studios just outside Park City.

Aster said the Utah crew, some of whom attended the premiere screening, were “amazing. … I would recommend it to anyone to shoot here.”

The movie stars Toni Collette and Gabriel Byrne as parents whose children — teen son Peter (Alex Wolff, of “Jumanji”) and 13-year-old daughter Charlie (Milly Shapiro) — start acting strangely after the kids’ grandmother dies.

“Hereditary” is the movie debut for Shapiro, who won a Tony Honor as one of the four young girls to play the title role in the original Broadway production of “Matilda” in 2013. It’s also one of five movies at Sundance this year to feature Ann Dowd, who won an Emmy last year for her role in “The Handmaid’s Tale.”

Collette’s character, Annie, is an artist who creates miniature dioramas of the rooms of her house. Aster said those dioramas are a metaphor for what happens to the characters. “I wanted the family to feel like dolls in a dollhouse,” he said.

The miniatures were also a design challenge, Aster said, because it meant every detail of the sets had to be thought out in advance and re-created in dollhouse form. “I don’t know how we made it, and we almost didn’t,” he said.

“Hereditary” will be released by A24 Films later this year. It continues its Sundance screenings at 6 p.m. Wednesday at the Tower Theatre in Salt Lake City, then Wednesday and Saturday in Park City. See Sundance.org for details.