One of the perks of directing your own movie is that you get to give yourself all the best close-ups. “CHiPs,” a big-screen adaptation of the confoundingly popular ’80s TV show starring Erik Estrada, is brought to you by Dax Shepard, an actor whose most interesting feature is a perpetually clueless expression. In the opening scenes of his third directorial feature, his character, aspiring California Highway Patrolman John Baker, is lying in bed shirtless. The shot shows off his casually ripped abs. John may be a pill-popping idiot, but “CHiPs” would like you to know he’s a sexy pill-popping idiot.

John is also heterosexual. Given the immense progress our society has made in recent years around LGBT acceptance, this might appear an incidental plot point, but “CHiPs” is firm on this subject.

Advertisement:

Officer Baker signs up for law enforcement to win back his way-too-hot-for-him wife (Kristen Bell, wasted here) who has moved on to far greener pastures (a mustachioed Josh Duhamel). John repeatedly reminds everyone around him — and, ipso facto, the audience — that he intends to mend fences with his lady love. This puts him at odds with a fellow officer, Frank “Ponch” Poncherello (Michael Peña), an FBI agent assigned to investigate an undercover case. Ponch has sleuthing to do and doesn’t have time to play meter maid to all of Southern California. When the men meet for the first time, John attempts to give his new partner a hug in the locker room but is rebuffed. Real men put their shirts on first.

Ponch’s apprehension to embracing his barely clothed colleague is quickly validated. When John spies a fellow patrolman (Ryan Hansen) — also very straight — the men exchange a friendly, no homo back-pat. As their bodies briefly collide, their crotches touch. Ponch, staring at their bulging tighty-whities, is horrified. One has to wonder, though, why he was looking at their genitals to begin with.

“CHiPs” is yet another in a long line of Hollywood gay panic comedies, in which the closeness between men is played for constant laughs. This would appear to be a relic of the decade from which its source material originates — when gay people were deployed as punchlines in everything from “Night Shift” and “Teen Wolf” to “Revenge of the Nerds” — but homophobia hasn’t gone anywhere. It’s still flourishing in an industry that struggles to treat queer people with dignity and respect at a time when marginalized groups are calling for diverse representation. This unfortunate throwback is a reminder of how far we still have to go.

Advertisement:

“CHiPs” desperately wants to have it both ways by being cosmetically inclusive, even while mocking the very groups it portrays onscreen (many Ryan Murphy shows share this problem). Shortly after infiltrating his new group of coworkers, Ponch meets a ginger cop who describes himself as “Gay Terry,” whose sexuality is his only character trait. Jess Rowland reprises the role from Shepard’s previous feature, “Hit and Run,” in which his orientation was dealt with more respectfully. “Hit and Run” even snuck in a good Grindr joke.

But reducing Officer Rathbun to a cameo here does no one any favors. Aside from being introduced as the token gay, Terry has almost no lines in the film. His only memorable moment is a scene in which he confesses that he would sleep with either John or Ponch given the opportunity, playing on the tired stereotypes that all queer men lust after neckbearded straight dudes to lure into the sack (sorry, guys, we’re just not that into you).

Shepard, who also wrote “CHiPs,” is nothing if not well-meaning. Even as his script is deeply uncomfortable about the idea of men having sex with each other, it attempts to call out its own regressiveness, amounting to an extremely flaccid attempt at meta-commentary on toxic masculinity. When Ponch won’t give his colleague a shirtless hug, John claims it’s because his new co-worker is homophobic. Ponch protests that a) he doesn’t hate gay people, b) being repulsed at the idea of skin-to-skin contact with a stranger isn’t weird, and c) John is misusing the term. If homophobia, as Ponch straight-splains, is about the hatred of gay people, it doesn’t apply when there are no gays in the room.

Advertisement:

But it absolutely still applies. “CHiPs” takes great pains to illustrate that it’s down with homosexuality, and it’s revealed a colleague has been having an affair with a man in a way that’s refreshingly devoid of judgment. There’s a double standard here, though, when it comes to straight men. The film upholds the notion that the most repugnant and embarrassing insult that can be hurled at a straight man is the idea that he could be light in the loafers.

This comes to a head — quite literally — during a scene in which Ponch is called to the rescue when John falls out of bed. Officer Baker has titanium in his arm from previous injuries, and on rainy days the pain makes it difficult to move. Ponch must come help his ailing partner to the bathroom. At first, he is unwilling to do so because John is naked, as “CHiPs” finds every opportunity to get its director/star’s shirt off. Ponch is guilted into the deed and while helping out trips with John in his arms, accidentally getting a crotch in the face. The scene is meant to be uproarious, and for the audience in my theater, it got the job done. The characters’ gay panic meltdown was one of the few times the audience actually laughed.

Advertisement:

Hollywood movies keep going to this well because it effectively plays to the lowest common denominator — exploiting minority populations for cheap laughs in unfunny movies that desperately need a jolt of guffaws. It’s a sign of just how desperate and cynical so many studio comedies are.

Take the Robert De Niro-starring “Dirty Grandpa,” the nadir in a career that has already had its fair share of low points. De Niro was cast in the 2016 raunchfest as the appropriately named Dick Kelly, a septuagenarian retiree who’s like a horny Archie Bunker on amphetamines. His political incorrectness isn’t biting or satiric, as in the case of Norman Lear’s trailblazing sitcom. It’s just sad. After convincing his straitlaced grandson (Zac Efron) to take a Spring Break trip to Daytona Beach, the pair meet Bradley (Jeffrey Bowyer-Chapman), the gay BFF of party girl Lenore (Aubrey Plaza). Dick, always a charmer, repeatedly calls Bradley “twinkletoes” and “princess.” He later calls the idea of being black and LGBT “funny.”

There are so many examples of blatant homophobia in the genre loosely known as “bro comedy” — the post-Apatow strain of movies about hetero hijinks — that it would be impossible to include them all.

Advertisement:

“Wedding Crashers,” the sleeper smash in which two bachelors show up at strangers’ weddings for the free hooch, features a subplot in which the Duane Hall-like brother (Keir O’Donnell) of pretty love interest Claire (Rachel McAdams) makes a nude portrait of Jeremy (Vince Vaughn). Todd, sneaking into Jeremy’s bedroom at night with a declaration of love, claims the painting is “violent and sexual.” In “The Hangover Part II,” ever-hapless Stu (Ed Helms) gets his “Crying Game” on: He’s horrified to learn he had sex with a trans woman (Yasmin Lee), whose anatomy is flashed on screen for extra shock value, while blackout drunk. “Get Hard,” starring Will Ferrell and Kevin Hart, is 90 minutes of prison rape jokes. Even the title is a prison rape joke.

The obvious solution to the pervasive gay panic in movies like “Hot Tub Time Machine 2,” “Role Models,” “Meet the Spartans,” “Harold and Kumar Escape from Guantanamo Bay,” and “Horrible Bosses 2” is to simply not see them. You have a choice where to spend your money. But even if you don’t buy a ticket, lots of other people will. “I Now Pronounce You Chuck and Larry,” in which the most humiliating debasement that straight men can face is to be forced to pretend to be gay in order to get health benefits, made over $100 million. “The Hangover Part II” is the highest-grossing R-rated comedy ever made (not counting superhero movies).

When these movies repeatedly reinforce that LGBT people are laughable and ridiculous, it sends the message that they are less human. It might get you a laugh, but it’s at the expense of the basic dignity with which we all deserve to be treated.

Advertisement:

Thankfully, a handful of movies have done a stellar job of undercutting the mundane bigotry of mainstream studio efforts. There’s “Deadpool,” which treats anal sex not like a horrific nightmare but a pleasurable activity its hero (Ryan Reynolds) liberally enjoys. Don’t knock it ’til you try it. “22 Jump Street,” the Rolls Royce of bro comedies, upends gay panic tropes with a scene in which a pair of detectives posing as college students (Jonah Hill and Channing Tatum) pretend to be engaging in same-sex fellatio in order to throw some drug dealers off their scent. When the criminals call them “faggots,” Janko (Tatum) isn’t upset they think he’s gay. He’s mad that they used a homophobic slur. “It’s 2014, asshole,” Jenko responds.

Three years later, “CHiPs” clearly hasn’t gotten the message.