To prepare Julianne Moore for her role as a lesbian parent in “The Kids Are All Right,” out director/co-writer Lisa Cholodenko gave her some critical materials to study: gay porn.

“Yeah!” Moore laughs, discussing the film in Manhattan’s Waldorf Astoria hotel in late June 2010. To explain: Moore and Annette Bening play Jules and Nic, a middle-aged lesbian couple who spice up their sex life by watching gay male porn — which their 15-year-old son, Laser (Josh Hutchinson), discovers and has a very awkward discussion with them about. “That stuff is really funny,” Moore admits regarding the scenes. “I love the honesty with which they explain it [to him]. It’s really adorable.”

This is but one raucously funny sequence in the “High Art” director’s third feature, which she co-wrote with longtime acquaintance, heterosexual screenwriter Stuart Blumberg (“Keeping the Faith,” “The Girl Next Door”).

Debuting to acclaim and ecstatic reviews at 2010’s Sundance and Berlin Film Festivals, “The Kids” begins when Nic and Jules’ two children, Laser and 18-year-old Joni (Mia Wasikowska), who were conceived via artificial insemination with sperm from an anonymous donor, track down their biological father, Paul (Mark Ruffalo). A laid-back restaurateur, Paul is intrigued by his sudden “father” status, and slowly ingratiates himself within the family unit. Nic, a physician with a strict if not uptight disposition, isn’t exactly enthralled with this development, but Jules, in the midst of an identity crisis as far as career and life ambitions, develops a rapport with Paul — and unexpected sexual chemistry, which leads to explosive complications for all involved.

Comedic and sharply drawn, “The Kids” represents Cholodenko’s first screenplay collaboration. While ultimately symbiotic — Blumberg gets credit for insisting they include the deliciously funny gay porn bit, which was borne from a random writing break conversation — Cholodenko admits the scripting process, which commenced following the release of her 2002 feature “Laurel Canyon” and endured for the better part of a decade, was fraught with tension and disagreement.

“There were times we wanted to throttle each other and quit,” she says. “It was protracted and painstaking and [there were] differences of opinion, but ultimately we defaulted to where we began. I liked that he was bringing a comedic and commercial sensibility and he liked I was bringing a more auteur sensibility and we each wanted a little something of what the other had or could do well.”

The script also reflected some personal events in Cholodenko’s and Blumberg’s own lives. She and long-term partner Wendy Melvoin (of Wendy & Lisa fame) were attempting to get pregnant (and succeeded in 2006, which brought things to a temporary halt). And Blumberg had been a sperm donor while in college.

A family tale: (clockwise from top left) Mark Ruffalo as Paul, Mia Wasikowska as Joni, Annette Bening as Nic, Josh Hutcherson as Laser and Julianne Moore as Jules. Photos courtesy Focus Features, credit Suzanne Tenner.

Luckily, they also had Moore attached from an early stage. Moore, who played queer and sexually fluid characters in films including “The Hours” and “Chloe,” says she had been determined to work with Cholodenko before they even met. Smitten with Cholodenko’s 1998 feature debut, “High Art,” she met the director at a Women In Film luncheon a few years later.

“We said we’d like to work together,” Moore recalls, “so we had a meeting and later she sent me [an early draft of “The Kids”] but I probably would have done anything. For me, it’s an examination of a long-term relationship and middle-age marriage and that’s really interesting and unusual.”

Over the years the script went through numerous drafts, with major shifts in both its tone and scope. “There was originally a river rafting trip that all the big drama happened on,” Cholodenko shares. “Once that went away because we realized we weren’t going to get $15 million to make the film, we really just focused in on the characters [because] that was the material that was going to make or break this film. But the biggest shift was the comedy and pushing that out front and center more than it had been in earlier passes.”

Although Moore remained attached during the lengthy writing and pre-production process, the actor filling the shoes of Nic remained a mystery until late in the game. “By the time they finally had the script and kinetic tone they wanted,” Moore shares, “Lisa had a short list of people and said, ‘what do you think of Annette? She’s the one I really see in this.’ I was like, ‘that sounds great. I don’t know Annette but I’ll email her.’ So I did. It’s a way to cut through. Things can take months if you [go through] an

agent, but you can generally get a response from a peer pretty quickly.”

The character of Jules, whom in stark contrast to the disciplined and focused Nic lacks a rudder as far as her career and destiny, proved an irresistible, meaty prospect. “She’s caught in a moment in time when she’s so uncertain,” Moore says, “she doesn’t know what her next move is. She doesn’t even understand why she feels the way she does. You’ve been taking care of the kids for 18 years and suddenly are like, wow, I’ve got to get it together because they’re going [away]. So I like that and her swipes at change. It’s messy, interesting and compelling.”

As for the aspect of Jules she liked the least? “That she cheats,” Moore responds. “It’s not admirable what she does, it’s really tough. It’s not intentional and it’s hurtful. It was a challenge to play. How do you rebound from something like that?”

A womanizer and cuckold on one hand yet a sensitive male who listens to Joni Mitchell on the other, the complex character of Paul (of whom even Ruffalo admits, “what the guy does is pretty fucked-up”) represented one of the film’s greatest creative successes, says Cholodenko. “That was some real brain surgery for us,” she admits. “We kept pushing until he was the right balance of sympathetic and schmucky.” : :