Robin Williams gets the documentary he deserves with “Robin Williams: Come Inside My Mind,” which debuts on HBO on Monday, July 16. It explores every period of his life, using interviews, behind-the-scenes footage and clips of him in performance, to create a portrait not just of a career, but of a person.

Indeed, it’s as a person that Williams most touched people. The outpouring of grief that followed his death in 2014 was unusual, even for a beloved celebrity. People felt that they knew him. He seemed to speak from his vulnerable inner self, and he reached people. Certain things can’t be faked: Here’s a man whose career reached the stratosphere, who had every license to misbehave and every reason for others to envy him, and yet it’s impossible to find anyone who’ll say a harsh word about him, and such was the case when he was alive, as well.

Yet there’s a paradox in this. In the movie’s first moments, even before the opening credits, we see Williams in a variety of talk show venues and stage performances, going off on one of his patented riffs, and his quality seems mannered and covered, not open. It’s a curious way for director Marina Zenovich to begin the documentary, and perhaps unintentional: He’s not funny. To see these manic monologues, which blew audiences away in the late ’70s and early ’80s, is to realize how poorly they’ve dated.

At the same time, to watch this footage is to root for him, and to receive his energy, not as an imposition, but as a generous act. When we’re talking about Robin Williams, or at least the lasting part of Williams’ work, we may be talking less about comedy and more about something more mysterious. Yes, there are laughs in the movie — he’s hilarious, for example, when he loses the Critic’s Choice Award. (“Coming here with no expectations, leaving here with no expectations — it’s pretty much been a Buddhist evening for me.”) But his deepest appeal was as a sensitive spirit.

At 16, Williams was at an all-boys school in Illinois, and then his family moved to the Bay Area, and his life changed. He connected immediately with the freer atmosphere of San Francisco in the late 1960s. He studied acting at the College of Marin and had a formative experience at the Edinburgh Festival Fringe, appearing in a Western-style production of “The Taming of the Shrew.” Impressively, Zenovich was able to locate silent footage of that performance.

Williams had been interested in comedy ever since he was a child and saw Jonathan Winters on television. But unlike most future comedians, he sought training as an actor. He attended the Juilliard School, in its early days under its first director, John Houseman, where he studied acting, voice and movement, all of which he put to use, not only in his film work, but also in his stage career. At one point, Williams recalls, in an interview, an incident in which he was performing in a nightclub and the microphones went out. Because of his vocal training, his voice could still fill the room.

A series of lucky accidents landed him as TV’s hottest comedy star in the late 1970s. His guest appearance as the spaceman Mork was a sensation on “Happy Days.” And then a sudden hole appeared on the ABC schedule, and “Mork and Mindy” was devised to fill it. Suddenly, everybody knew Robin Williams. He woke up famous.

One of the more interesting aspects of the documentary is the way it shows the impact of sudden fame, particularly on a young man. He had recently married Valerie Velardi, and the fame altered the terms of their relationship. Instead of their marriage being a mutual “adventure,” as she puts it in an on-camera interview, there was this huge career to deal with. Williams had one-night stands with other women. He developed a serious cocaine habit and only stopped after his friend John Belushi died. Even on a nice guy like Williams, fame took its toll.

Though the documentary doesn’t exactly skate over Williams’ film career, it barely takes time to register the milestones, such as “Good Morning, Vietnam,” “Mrs. Doubtfire” and “Good Will Hunting.” The emphasis is on the personal, and it clears up some facts. For example, according to the gossip at the time, Williams was having an affair with his child’s nanny, the woman who would become his second wife, while he was still married to Velardi. But Velardi herself debunks that. Nothing happened between Williams and Marsha Garces until the first marriage was over.

The movie devotes proper emotional consideration to the physical and mental problems that led to Williams’ suicide at age 63. Various friends and colleagues, including Billy Crystal, Bob Goldthwait and Pam Dawber, note that they could see there was something wrong in that last year or two. Only later, with the autopsy, was it discovered that Williams had Lewy body dementia, a cruel illness to befall someone at any age, much less a person in their prime.

But even acknowledging the deep sadness of Williams’ last chapter, the documentary finds a way to leave us with the sense of a consequential life — not a triumphal life, because no one gets out of here alive, but a life that mattered to people in an unusual way. “Robin Williams: Come Inside My Mind” captures that special quality that Williams had, the extra quality that went beyond the laughs, that communicated his whole being.

Mick LaSalle is The San Francisco Chronicle’s film critic. Email: mlasalle@sfchronicle.com Twitter: @MickLaSalle

More Information Robin Williams: Come Inside My Mind: Documentary. Directed by Marina Zenovich. (The documentary debuts on Monday, July 16, on HBO)