Danny McBride and Adam Devine play brothers on HBO’s new comedy “ The Righteous Gemstones ” — but in their very first meeting, Devine had to flee.

“I met Danny at a party once [a few years ago],” says Devine, 35. “And I go, ‘You’re a bright shooting star!’ I was just so nervous to meet him, because he’s on the Mount Rushmore of comedy heroes for me. Then I immediately grabbed my girlfriend and said, ‘I just called him a shooting star — we have to leave!’ ”

“The Righteous Gemstones” is a half-hour series following a famous and wealthy family of televangelists, which includes patriarch Eli Gemstone (John Goodman), oldest son Jesse (McBride), daughter Judy (Edi Patterson), and youngest son Kelvin (Devine), who Devine says is modeled after “every cool-guy youth minister that gets the Justin Biebers and Ariana Grandes of the world to come to their churches.”

It’s the third HBO show McBride has created and starred in, after “Eastbound & Down” (2009-2013) and “Vice Principals” (2016-2017). The latter inspired “The Righteous Gemstones.”

“I had never been to [Charleston, SC] before and we shot ‘Vice Principals’ there,” says McBride, 42. “I just fell in love with the city. I went back to LA and we were like the cast of ‘Lost,’ like, ‘We have to get back to the island!’ So we moved down there.”

‘There was a broader story to tell about the idea of people practicing what they preach.’

McBride has lived in Charleston with his wife and kids and several of his friends for two years now — and “The Righteous Gemstones” was filmed there. Churches, fortunately, are ubiquitous.

“I was trying to come up with an idea about another world I wanted to tell a story in. Moving to a place like Charleston, there’s a church every mile,” he says. “The more I started researching some of these mega-churches and seeing the kind of antics that pastors get up to, it started to feel like it was a ripe setting for this story I wanted to tell.”

It’s also a setting McBride knew well from his childhood in Virginia.

“My parents were really involved in church. My mom did the puppet ministry, she’d write these puppet shows for children. So I spent every Sunday helping her load this puppet stage and breaking it down afterwards,” he says. “Then, after my parents got divorced when I was in sixth grade, it was odd. My dad ran out on us and my mom worked in a department store and had two kids and dedicated all this time to the church. We were in a position where we could have used the help of the church. And instead, people kind of shunned my mom because she had a divorce.”

It’s that kind of behavior he wants to poke fun at in “The Righteous Gemstones,” not religion itself, he says.

“I have no qualms with religion. For me, this is more a story about hypocrisy. I think it’s present in our world all over the place, not just in religion. In the world of how people chose to present themselves on social media … So it felt like there was a broader story to tell about the idea of people practicing what they preach.”

“I watched a bunch of videos of these [mega-church pastors] defending the fact that they need multiple private jets in order to get around the world to preach,” says Devine. “We’re not making fun of religion, that’s something Danny was adamant about. But hypocrisy at the highest level should be made fun of. That’s what we’re trying to do.”

“The Righteous Gemstones” Series Premiere Sunday, 10 p.m., HBO