There’s no question that television has been vital in altering perceptions on gay rights, perhaps more than with any other social issue. Yet while TV’s advancement might not seem that way in hindsight — perhaps especially to the movement’s opponents — its role as a progressive force has hardly been a steady forward march. Instead, its history has been more accurately characterized by advance and retreat. The theory that TV pursued some orchestrated agenda is
belied by the jagged line that has been followed from “That Certain Summer” — a breakthrough 1972 movie about a teenager learning that his father is gay — to the panoply of characters currently featured in programs, which prompted GLAAD to state last fall that television is “playing a key role in promoting cultural understanding of LGBT lives around the world.”

It is also almost impossible to separate the impact of popular TV personalities coming out, such as Ellen DeGeneres, Rosie O’Donnell and, more recently, Robin Roberts, after having established a rapport with the audience. If the path to greater gay acceptance has been paved by a softening of attitudes once someone learns a friend or relative is gay, celebrities — perhaps especially from daytime TV, which actively cultivates such bonds — have hastened and reinforced that sensation, sometimes before people were touched on a personal level.

But television’s otherwise incremental approach when it comes to exploring groundbreaking issues can be traced, in large part, to the skittishness of advertisers over sponsoring controversial fare. Programs that have delved into such material tended to experience a financial hit, which would inevitably lead to some backing away at the network level, until another producer again braved the waters.

It’s worth noting, too, that while far more honest and explicit portrayals of gay life found their way to premium cable, charting the progress via network TV provides the best chronological guide in tracking shifting attitudes — especially going back to earlier decades, when the gap between niche cable audiences and the mass appeal of the major broadcasters was far more pronounced.

No column-length discussion of this issue can possibly be comprehensive, but it’s fair to say early breakthroughs were largely confined to TV movies, from “That Certain Summer” to 1985’s “An Early Frost,” which centered on a gay man who has AIDS. Even in that genre, networks required a certain backbone, or at least forgiving accountants. A decade later, NBC’s “Serving in Silence: The Margarethe Cammermeyer Story” was enough of a lightning rod to trigger a formidable backlash thanks to a rather chaste kiss shared by Glenn Close and Judy Davis.

This pattern of controversy continued when series picked up the gantlet. “All in the Family” dealt with the issue, yes, but some of the more memorable interludes waited until the 1980s and ’90s: Wilson Cruz’s heartbreaking gay teen on “My So-Called Life.” Two men in bed together on “Thirtysomething” in 1989, “Roseanne” exchanging a kiss with a lesbian, and later helping to organize an early gay wedding involving her boss. The marriage of Ross’ ex-wife on “Friends,” or the magical (literally, in this case) pairing of Willow and Tara on “Buffy the Vampire Slayer.”

Although gay characters became more prevalent, they were seldom allowed to exhibit any kind of affection, and usually were confined to supporting roles. Even as comedies became more sophisticated, there was plenty of derision regarding the gay best friend as a sort of chic sitcom accessory.

All that led to “Ellen,” in which DeGeneres’ character came out in 1997 almost simultaneously with the star herself. Yet while the episode was an enormous ratings draw, it’s worth remembering it was also an act of creative desperation. Hence its tongue-in-cheek title, “The Puppy Episode,” which had been the plot the producers were discussing (“Ellen gets a puppy”) before they decided to press for something with greater relevance.

A year later, NBC introduced “Will & Grace,” whose significance owed a lot to its real estate — the very notion of planting a show with a gay leading character in the heart of the network’s “Must-See TV” line-up, when that designation still mattered.

The floodgates gradually began to open, from an assortment of gay couples (and marriages) in popular dramas to Mitchell and Cam on “Modern Family” to the relationship between Kurt and his dad on the early seasons of “Glee.”

Those who might think it was full steam ahead after “Ellen,” though, are fuzzy on their history. In fact, ABC slapped a parental-advisory label on the show, and sought to curb gay storylines — to the point where DeGeneres and executive producer Tim Doyle threatened to quit.

“This advisory is telling kids something’s wrong with being gay,” DeGeneres protested at the time. “It’s like if they had a black show and put on a warning that said this show isn’t suitable for viewers who don’t like black people.” As for ABC, it was reported that the network preferred “baby steps” when it came to exploring the character’s sexuality.

The “Ellen” experience offers a kind of historical microcosm, reflecting the push and pull that has gradually moved the conversation forward. TV hasn’t always been a profile in courage, usually coming closer to taking such tiny steps than full strides. Yet with the tide now flowing steadily in a progressive direction, there’s pretty clearly no turning back.