Sometimes Kevin Smith acts like the Spike Lee of crass comedy.

Yes, Kevin. Audiences know “every movie needs an ending,” as clumsily written for the otherwise smooth-speaking Craig Robinson in Zack and Miri Make a Porno.

Too bad Smith doesn’t bother to write one that’s not anticlimactic (on the porno side) or predictable (on the romantic side). But it’s forgivable. Smith mercifully listened to someone telling him it’s OK to move the camera now and again, finally leave New Jersey and not confuse poignancy for goopiness.

Judd Apatow might have commented about society’s response to pornography, but Smith contentedly settles for a sweetly cartoonish, quasi-autobiographical story about porn propelling a couple away from ruin and toward romance.

Last seen together in flagrante delicto at the end of The 40-Year-Old Virgin, Seth Rogen and Elizabeth Banks star as the titular pair. That there’s desperation behind Miri’s flirtation — and weariness behind Zack’s profane taunts — contributes to their chemistry.

They play lifelong friends and roommates in Monroeville, Pa., a Pittsburgh suburb that looks like it’s been bombarded by thundersnow. One moving-camera composition Smith strikes with is an opening-scene car crash with a rascal’s eye to establish the bleakness of winter.

Zack and Miri are the people for whom partial-payment plans were made — a surly barista (Zack) and mall employee (Miri) perpetually behind on their utilities. But that doesn’t stop them from attending their 10-year class reunion, where Miri hopes bedding high-school stud Bobby Long (Brandon Routh of Superman Returns) will solve her woes.

It turns out Bobby is gay and dating Brandon St. Randy (Justin Long), a gay-porn star Zack mistakes for a star of “adult male films” like Glengarry Glen Ross. A scene that starts off hilariously goes on easily seven beats too long, but it sets up the concept of this comedy.

When the power, water and heat go out, Zack brainstorms an idea inspired by his chat with Brandon — he and Miri make a porno, sell 1,000 copies for $20 each and escape debt.

Titled Star Whores, it’s produced by Zack’s racially passive-aggressive pal Delaney (Robinson, a master of comedic murmurs) and filmed by a wannabe cinematographer (Jeff Anderson of Clerks). Co-stars include Stacey and Bubbles (real-life porn actresses Katie Morgan and Traci Lords) and Lester (Smith staple Jason Mewes), who can get erect on demand.

Complications rise, though, when Zack and Miri get to their planned sex scene — and keeping emotions out of it threatens to derail both their friendship and the movie.

Using a cheesy Live song during Zack and Miri’s initial porn scene does Smith no favors. But the physical-emotional flashpoint Rogen and Banks find within it — written all over their surprisingly elated faces — is surprisingly tender.

It’s Rogen and Banks’ connection — and Robinson’s way with a line that demands he get his own lead film right now — that sustains the film through sloppily timed poop jokes. One of them is the nastiest thing Smith has put in any of his films.

Take Zack’s story in terms of Smith’s life, and it’s the idea of ambition and actualization through film. Smith may have hit his only possible high points with Chasing Amy and Dogma, but Zack and Miri is yet another of his breezy, passable comedies.