The 40th birthday party in the Catskills this past summer was full of adult entertainment: swimming, a pig roast and a few joints.

When one attendee — a 53-year-old filmmaker who lives in Cobble Hill — asked another partygoer for a light to spark one up, she instead pulled out a sleek hand-held contraption that looked like an oversize USB drive.

Turned out it was a Pax vaporizer, a high-tech gadget that has stormed the market for upscale marijuana devices since it debuted last year. (Officially, Pax markets its products as vaporizers for loose-leaf tobacco.)

“I was smitten immediately,” says the filmmaker, who, like most people in this story, asked that his name not be used so he could discuss his illegal drug use. “This was just so easy — really smooth.”

After the party, he promptly went online to buy one of the $250 devices, and started using it regularly, even going on a bit of a pot bender with it, after 40 years of smoking from traditional joints and pipes.

“It was like Christmas morning for a few months,” he says.

The filmmaker is far from alone: John Smith, manager of Smoking Culture on West Fourth Street in the Village, estimates his shop sells 50 to 100 vaporizers a week, making them the second most popular item after regular hand-blown glass bowls.

“I get a lot of upper-class guys in here,” says Smith. “They’ve got money, they’re captains of industry.”

While a basic bowl costs as little as $20, most of the popular vaporizer models start at $250 and can run as much as $700.

“I smoke so much, I’d been giving myself sinus infections,” says one 25-year-old graphic designer in Bushwick who recently switched to a Pax after a decade of smoking daily via bowls and joints.

She felt a difference right away: “It feels so much better to be smoking a vaporizer. I’ve been getting sick less.”

Unlike traditional smoking devices, which burn marijuana directly, there is no ash or harsh smoke. (Vaporizers originally caught on in the early ’90s with asthma and cancer patients who got high for either recreational or medicinal purposes.)

The devices are fairly simple to operate: Users place a few pinches of marijuana into a small compartment, then press a button to activate a heating element that operates much like a convection oven, stripping the plant’s cannabinoids — including its psychotropic THC molecules — and releasing a vapor containing just the good stuff. (The portable devices use rechargeable batteries; pricier at-home models run off power cords.)

The user then inhales through a mouthpiece.

“We are not regular smokers, but when we do, [a vaporizer offers] a much more pleasant experience,” says one 36-year-old nonprofit professional who lives with her fiancé in the Financial District.

Another big plus?

The vapor, while not entirely scentless, is far more discreet than the usual big ol’ dank cloud of smoke.

“It leaves less of an odor for our neighbors,” notes the professional.

Users report the ability to toke away in public, without fear of alerting every cop within sniffing range.

“I have used it in Brooklyn Bowl, the Gutter, Yankee Stadium, many streets, bars, parks, people’s homes,” one 29-year-old educator, who lives in Crown Heights and teaches classes at a popular city attraction, says of his Iolite, a handheld vaporizer that looks like a walkie-talkie.

“It’s way less obvious than a bowl or joint.”

A 30-year-old musician in Bushwick says he’s used his pen-like vaporizer in movie theaters, subway trains, airplanes and at baseball games.

“It’s perfect for those things,” he says. “We’re going to a Mets game, we can blaze the whole time.”

It’s that kind of brazenness that has some people worried that pot smokers could be getting high, well, everywhere.

Brooklyn Bowl, for instance, recently banned electronic cigarettes because, a bouncer says, people were using marijuana vaporizers in the club, and it was too hard to tell the difference between the two.

But while smoking weed is still illegal, it’s hardly a major offense here in New York City: Getting caught in public with less than 25 grams of marijuana — though technically a misdemeanor — usually results in a civil penalty (a $100 ticket for first-time offenders; $200 for a second offense).

And during his campaign, Mayor-Elect Bill de Blasio stated that he supported decriminalizing possession of less than 15 grams.

James Monsees, CEO of Ploom, the company that makes the Pax, says vaporization is only going to spread as marijuana laws loosen around the country: Last year, Colorado and Washington state legalized small amounts of marijuana for personal use, and a Gallup poll released last month found that 58 percent of Americans are OK with pot being legal — the first time a majority has given the thumbs up to lighting up.

“It’s the refinement of those products that makes them much more attractive on a mass scale,” says Monsees, especially “in states in the US where cannabis laws are being changed.”

Meanwhile, even skeptical smokers who cherish the sacred tradition of sitting down with friends, rolling a communal joint and passing it around are shifting their habits.

“I brought it to my boy’s house, and he was like, ‘There’s no way this is going to get us high,’ ” says Vincent Johnson, a 26-year-old bartender in Bayonne, who uses a device in which vapor is sucked out of a tube.

“They were amazed. It does the trick. We just pass the tube to each other.”

How the Pax — the iPod of pot vaporizers — works

Step 1: Once the battery is fully charged, open up the magnetic oven compartment on the bottom. Experts recommend grinding the weed first, which increases surface area.

Step 2: Close the compartment and click the retractable mouthpiece, which will snap into the ‘‘on’’ position. The light on the side glows different colors while it is heating. Once it’s green, it’s ready to use.

Step 3: Put the mouthpiece between your lips and inhale. Short, quick puffs are all that is needed. Even if it doesn’t look like anything is coming out, it is. Good indicators that it’s done? The product will turn a dark brown color and have a burnt-popcorn taste and smell.

Step 4: When finished, just push the mouthpiece back in to return it to “off” mode. Don’t throw away the leftovers! Depending on how long the product has been vaped and how well it has been ground, it may still have an effect: The Internet is rife with recipes for stoners who use leftovers to make pot butter for baked goods.