Los Angeles, 1982.

Richard was in the pool when someone brought him the phone. Now he's standing at the side of the blue pool, water slapping and caressing his gym-toned Hollywood torso, and he's talking down the line as the girl he spent the night with dives into the welcoming water. Who's he talking to? Another woman, most likely. Whispering sweet, dirty nothings into the ear of some Lauren Hutton lookalike on the other side of the city. Maybe it is Lauren Hutton. "Come over baby. We can have some fun. There's no-one else here. No-one else. It's cool. Come over. Come on in -"

As he talks the sun beats down like it always does on this part of the world, like it always does on these people living the dream life, all these actors and wannabe actors and film-makers and photographers and artists and architects and advertising executives and gigolos and oilmen's daughters. Everyone but the waiter. He has to stand in the shade.

What's this? It's just a story. But it's the kind of story we want to hear about the Hollywood life. There are, it's said, more than a million pools in southern California and in our heads every one of them is full of Hollywood stars and/or beautiful people, taut and tanned, swimming, sunning themselves, posing, kissing. We remember stories of Greta Garbo – or was it Marilyn Monroe? – supposedly swimming naked in the pool at the Chateau Marmont. We think of David Hockney taking Polaroids of young blond Adonises cutting back and forth, back and forth, or maybe Bob Mizer's infamous gay backyard pool parties and the photos he took for Physique Pictorial. We recall that picture of Faye Dunaway taken by her soon-to-be husband Terry O'Neill on the morning of March 29, 1977, as she sits by the pool in a silken dressing gown and high heels the morning after the night before. The papers around her feet are full of her name and in among the breakfast dishes her Oscar stands to attention.

All these stories and movies and old photographs blend and swamp us. The swimming pool in California deliquesces in our imagination into a fevered dream of celebrity, sex, sun and success. You can picture the scene, can't you? The empty blue sky, the palm trees stretching high above the glass-fronted house and the blue, blue water in the hottest part of the day, the heat a living thing. The day feels stilled by it, drugged almost. The afternoon throbs in silence, until the diving arc of a body sends displaced water spraying up in a white liquid rush. A bigger splash.

This is the dream of life that California represented for many of us for most of the 20th century. There was space and there was the weather so why not stretch out? Why not build yourself a pool in the back garden? And so after the war the golden life was suburbanised, wood and concrete and steel boxes were erected on the hills around Los Angeles and you'd sit by the pool looking out over the city's haze and if your architect was good enough and the view was cool enough the architectural photographer Julius Shulman would come and take a picture of you sitting there living the life, proving you'd made it. "I came to Los Angeles for two reasons," Hockney once said. "The first was a photo by Julius Shulman of Case Study House #21, and the other was AMG's Physique Pictorial." Sun and success and sex, the dream echoed and echoed down the years.

And yet. And yet.

The first pool I came across on my first visit to Los Angeles was something of a disappointment. I climbed up on to the roof of the Holiday Inn in Hollywood where I was staying, to discover it, a wind-chilled and wave-whipped patch of water, a silent, forlorn-looking thing. No-one ploughed through its silken depths. Nobody sat sunning themselves by its side. My head full of James Ellroy novels, I couldn't help but think it most resembled a crime scene in waiting. Later I would go and sit by the pool at the Sunset Marquis and talk to Bob Marley's son, but I can't really recall that pool. The one in the Holiday Inn stayed with me. Perhaps it seemed more real. Or because it spoke to the secret nightmare that California incubates; that the dream is not real. That it's a golden lie. That eventually, as in the opening and closing sequences of Sunset Boulevard, a body (William Holden's in this case) will turn up floating in the water. And once we've thought of Billy Wilder's movie, the other great Hollywood film about California and water and the dangerous confluence of the two comes to mind – Polanski's Chinatown, a vision of capitalist corruption told in neon, and a reminder that southern California was once desert. As the film's brilliant monster Noah Cross says: "Either you bring the water to LA, or you bring LA to the water."

That may not be enough any more. As media theorist and sociologist Dick Hebdige points out, the Californian dream is last century's dream. "In 2004 the Los Angeles Times reported that according to the Metropolitan Water District, 19,659 gallons of water evaporate from a typical uncovered pool each year. Extravagance on that scale is hardly justifiable in a world where - one in three people do not have access to potable water -"

Perhaps the real visionary, then, was the late science-fiction writer JG Ballard, who filled his stories with visions of drained swimming pools, full of cracked tiles and sand drifts. Dreams fade away, dry up. But then maybe it depends on who's doing the dreaming. In the 1970s California was hit by a drought. Water-saving measures were put in place and pools began to be seen as an unnecessary luxury. Many were suddenly drained and left empty.

But that just meant they offered a new opportunity as the young men of California started carving and grinding and ollying their way around and through and over the dead pools. So maybe the dream didn't die. It just went skateboarding.

Backyard Oasis: The Swimming Pool In Southern California Photography, 1945-1982, is published by Prestel, priced £40.