SAN FRANCISCO -- I had met Robin Williams before, a few times, but seeing him in January on the set of his now canceled sitcom "The Crazy Ones" was different. I say this not with the benefit of hindsight but because I felt it at the time. It wasn't just that he was less manic than I recalled but that there was an almost unnerving sense of sadness about him that I hadn't seen before.

I have always believed that television didn't create Robin Williams as much as Williams re-created television comedy. With the 1978 premiere of "Mork and Mindy" on ABC, the sitcoms Americans had known for years, from "Father Knows Best" through "The Beverly Hillbillies," had to make room for a new kind of improv-based, youthful humor - the kind of antiestablishment humor we had been drawn to for three years at that point on "Saturday Night Live."

'Happy Days' spin-off

But "Mork and Mindy' was a prime-time show, not a late-night Saturday show seen largely by college kids and their younger siblings who could sneak downstairs after mom and dad went to bed. The entire concept of the show, a spin-off from Garry Marshall's "Happy Days," was loopy, of course, with Williams playing Mork from the planet Ork who arrived on Earth in a giant egg and had to report regularly to his perpetually exasperated superior Orson.

As he attempted to understand human life and habits under the patient tutelage of Mindy McConnell (Pam Dawber), Mork slept upside down in a closet and packed a world of expression into what became the oft repeated catch phrases "Shazbot" and "Na-nu, Na-nu." Williams made the character an irrepressible man-child, and extended that persona to his appearances on late night talk shows. His first appearance on "The Tonight Show" in 1981 remains one of the greatest moments in the storied history of the Johnny Carson years.

In the final season of "Mork's" four-year run, Williams was able to work with his idol, Jonathan Winters, who appeared as the child of the now married Mork and Mindy. Just watching Williams and Winters in the same scene was a reason for many viewers to keep tuning in. In retrospect, it was probably a bad idea if it was meant to save the show, but still, here were the two greatest boundary-busting TV comics of all time, behaving like the overgrown precocious children that, at heart, they both were.

Winters' influence

Winters was a TV groundbreaker as well. His humor was especially cherished by Jack Paar and Carson (whose Aunt Blabby was a bewigged homage to Winters' Maude Frickert). It's easy to see why Williams so admired Winters, and how much Williams was, in many ways, the next generation's version of Winters. Winters tended toward delivering deadpan rejoinders and slowly unwinding stories that seemed to go nowhere and left you convulsing on the floor. Williams was known for rat-a-tat-tat mania, spitting jokes out faster than a tennis ball machine, his mind seeming to scurry around out of control. In both cases, there was an unmistakable element of danger in the comedy of these men.

Williams of course went on to a robust film career, winning an Oscar for "Good Will Hunting," delivering extraordinary performances in films such as "Good Morning Vietnam," and finding enormous popular success in the drag role of "Mrs. Doubtfire." Other Williams films seemed incapable of containing his talent, which, of course, was outsized, something that was a cause for concern when he returned to the small screen last year in "The Crazy Ones."

Appearing with co-star Sarah Michelle Gellar at the Television Critics Association convention in the summer of 2013, Williams was asked directly if he'd be able to follow the script and how much improv would be allowed in the show.

David E. Kelley, who created the show, answered, describing how the show would try to accommodate Williams: "It sounds like he very much likes the box. He manages inside the box, gets the box down, and then we give him a few takes where he gets to break out of it. So the answer to the question was we had a script. We shot the script. After we got each scene, we'd go to Robin and say, "Do you want to play with it? Play with it." And he did. ... So what you have in the end is the architecture of the script, mainly the script, but you've got ad libs and the spontaneity and the joy of those moments on top of it."

"The bottom line," Williams added, "is he writes great stuff. It's a great base, and I've got great people to play off of. It's like heaven, a great ensemble. I loved it."

Ensemble cast

Anyone expecting "Mork Goes Into Advertising" when "The Crazy Ones" premiered in the fall of 2013 were in for a surprise. And maybe that was the problem. Williams cut loose from time to time, especially with actor James Wolk, but this really was an ensemble show and that may have disappointed viewers who were expecting the off-the-wall Robin Williams.

In January, members of the Television Critics Association were invited to the set to chat with the cast, who, with Kelley, were seated along the exterior wall of the window of the fake ad agency. Williams was personable, warm, and funny but also subdued - as if he were making a real effort to allow co-stars Gellar, Wolk, Hamish Linklater and Amanda Setton to shine.

But he did admit that returning to TV was an adjustment and seemed to struggle to put a good face on it.

"It's like a movie a week. I mean, the schedule is so ... there's days where you have eight pages of dialogue, and most movies you don't have that every day. ... So it's that boom, boom, boom, get ready, do it. ... The first couple of weeks was, like, all right, and then now I'm into the rhythm. And that's why it's great that it isn't totally a Robin Williams vehicle, because after a while I'd go 'F-.'"

Afterward, the critics gathered in scrums around various cast members. Williams was polite, somewhat taciturn. He took care to make sure every critic had a chance to ask a question, soliciting them if he realized someone hadn't yet spoken.

Sweetness and sadness

There was a sweetness about him that I'd seen before, but a sadness as well, a kind of listlessness. When the show was canceled a couple of months later, I thought back to that day in January and figured he and the rest of the cast obviously knew the show was in trouble then.

Today, I couldn't help wondering if for Williams, it was something else.

Robin Williams changed television comedy. His talent was singular, his presence unforgettable, his legacy, everlasting.

David Wiegand is The San Francisco Chronicle's executive features editor and TV critic. E-mail: Twitter: @WaitWhat_TV