The year is 1983.

Robin Williams’ first son, Zachary, is about to be baptized. His great friend from Juilliard, Christopher “Superman” Reeve, will be the godfather.

Someone notes the white baptismal gown with the cape-like attachment makes Zachary look like a super baby — and with that, Robin is gently cradling his son while zooming about the room, as the room erupts with joyous laughter.

It is a beautiful and sweet and funny moment — and it is melancholy as well, because we know what is ahead for the father and for the godfather.

The HBO documentary “Robin Williams: Come Inside My Mind” is primarily a celebration of the manic comic genius who killed on stages large and small, created one of the most memorable TV characters of the late 1970s and early 1980s and became a dual comedy-drama threat in movies, winning the supporting actor Academy Award for his brilliant work in “Good Will Hunting.”

But to the credit of filmmaker Marina Zenovich (whose previous work includes docs on Richard Pryor and Roman Polanski), “Come Inside My Mind” doesn’t shy away from exploring Williams’ battles with drug addiction and his struggles to stay clean even after such wake-up calls as the overdose death of his friend John Belushi in 1982. (Williams was one of the last people to see Belushi alive at the Chateau Marmont.)

Director Zenovich employs traditional documentary techniques and follows a mostly linear timeline, and applause to that choice — because one really doesn’t need too many bells and whistles when telling the story of such a blazing, bouncing-off-the-walls talent.

We see old black and white photos and film clips of the handsome young Robin (born in Chicago in 1951), who grew up as an only child (he had two half-brothers, but they lived in separate homes) and was a dutiful student and fine athlete before finding his passion at Juilliard.

Williams tells an anecdote about making the legendarily deadpan genius John Houseman burst into laughter at Juilliard. If he could crack Houseman, he could crack anybody!

At times the first half of the documentary seems shaped by which former loved ones and associates of Williams agreed to be interviewed. Of Williams’ three wives, only his first, Valerie Velardi, appears. (Though it must be said, Velardi provides some of the most insightful and touching recollections in the film.)

Not that “Mork and Mindy” should be glossed over, because of course it was a factor in Williams’ skyrocket ride to superstardom, but we spend almost too much time on the “Happy Days” spinoff, perhaps in part because of the thoughtful and quite forthcoming participation of Pam Dawber, Williams’ co-star on the sitcom.

Most fascinating are the clips of Williams careening all over the stage while bringing down the house in various stand-up appearances, and the interviews with his fellow comic greats David Steinberg, Billy Crystal, Eric Idle and David Letterman, among others. To a man, they recognize Williams’ gifts and they speak of his huge heart — but they also touch upon the sadness that often enveloped him in later years, and his various and increasingly serious health problems.

Crystal talks about Williams’ insatiable need to get laughs, even with an audience of one. Mark Romanek, who directed Williams in one of his finest roles in the chilling 2002 drama “One Hour Photo,” recalls how between takes of playing a psychologically damaged stalker, Williams would launch into wacky bits. (Seeing behind-the-scenes footage of Williams on the set, dressed in character and doing zany comedy, is bizarre.) Romanek said he learned to step back and let Williams get it out of his system so they could go back to the serious drama at hand.

(Personal sidebar: I met Williams for a dinner in 2002. It was the day we learned then-President George W. Bush had choked on a pretzel and temporarily lost consciousness. It was myself and one other person in the room when Williams entered. He immediately mimed taking a pretzel from the bar and launched into an impersonation of Bush collapsing, eventually winding up on the floor and spinning around maniacally. After that, we had a three-hour dinner — and the whole time, Williams was a low-key, thoughtful, fascinating conversationalist who never once got into any character of any kind. He was just … Robin Williams, a nice and intelligent man engaged in the moment.)

The latter sections of “Come Inside My Mind” aren’t laugh-free, but the film takes a necessary somber turn as Crystal, Dawber, Bobcat Goldthwait and others speak of almost unbearably sad encounters with Williams in his later years, when he always seemed to be in pain and was trying to mount a career comeback via independent films and the not-great TV series “The Crazy Ones.” There’s only the briefest mention of Williams having Lewy Body Dementia, the second most common type of progressive dementia after Alzheimer’s, which was almost certainly a factor in his suicide.

“His brain was giving him misinformation,” laments Goldthwait.

Robin Williams committed suicide Aug. 11, 2014. His ashes were scattered in the San Francisco Bay. His grown son Zachary, seen “flying” like a super-baby in that early clip, tells of taking a dip in those waters shortly thereafter, and feeling his father’s presence all around.

A fitting grace note for a fine tribute of a film.

★★★1⁄2

7 to 9 p.m. Monday on HBO, and also available then on HBO On Demand, HBO NOW and HBO GO