Thanks to LA-based crime novelists like Raymond Chandler and James M. Cain—and the fact that the major movie studios were based in Southern California anyway—Los Angeles became the setting of choice for a legion of gritty dramas that defined the noir genre.

The city itself wasn’t always seen. In the 1940s and ’50s, when most of the canonical noir films were made, most filming still took place on studio backlots and sound stages. But familiar parts of Los Angeles still found their way into classics like Double Indemnity, Kiss Me Deadly, and D.O.A.

One of the first noir films set in LA, Double Indemnity was based on a novel by Cain that was in turn inspired by a murder that took place in New York City. The crime, trial, and execution of “femme fatale” Ruth Snyder caused a media sensation.

But Cain—and later, director Billy Wilder—started the story in a lofty Spanish Colonial-style home, transposing the familiar details of the crime onto the unmistakable landscape of Southern California.

As film historian Thom Andersen points out in his classic documentary, Los Angeles Plays Itself, these stucco-covered homes with red tile roofs and winding interior staircases are cherished today as architectural gems emblematic of the city’s heritage. But in 1944, when Double Indemnity was made, a Spanish-style home could simply represent conspicuous, tasteless wealth—akin to a modern McMansion.

In the film, insurance salesman Walter Neff derisively remarks that the house “must have cost someone about $30,000 bucks—that is, if he ever finished paying for it.”

The bleakness of film noir countered a national sense of optimism in the postwar years, when the genre was most popular. As the U.S. economy boomed, and a burgeoning middle class flocked to the suburbs, noir offered lurid depictions of a society burdened by shameful secrets.

Full of movie stars, newly built tract houses, and coveted manufacturing jobs, Los Angeles was a perfect target for the genre’s sneering cynicism.

A quiet street in Glendale is the unlikely starting point for Mildred Pierce’s web of betrayal and murder. A romantic bungalow court in West Hollywood houses doomed lovers in In a Lonely Place. A glamorous mansion (located in real life closer to Wilshire) becomes a deathtrap for a young screenwriter in Sunset Boulevard.

The action in noir films from this period frequently jumps from freshly developed suburbs to the busy streets of Downtown LA, or even the wilds of Malibu. These jarring scenery changes—used to great effect in Kiss Me Deadly—convey a city of contrasts, where the glimmer of Hollywood concealed mean streets populated by loners and castoffs.

In the noir of the 1940s and ’50s, Los Angeles was a place where shocking crimes could still happen, in spite of all that sunshine and prosperity.

As Neff puts it in Double Indemnity: “Murder can sometimes smell like honeysuckle.”

By the 1970s, when contemporary filmmakers like Roman Polanski and Robert Altman began resurrecting the genre, widespread public distrust of authority colored depictions of Los Angeles. In Polanski’s Chinatown, the most iconic example, the city itself becomes a crime.

The film retells the story of the creation of the Los Angeles Aqueduct, which has for more than a century been siphoning off water from the Owens Valley, more than 200 miles away. In the movie, the plan to expand the city’s supply of drinking water turns out to be a shadowy conspiracy to enrich a small group of devious landowners.

There’s some truth to the premise, but screenwriter Robert Towne moved the action from the 1900s (when construction actually began on the aqueduct) to the 1930s, when the results of LA’s water-rich boom years were fully visible in the city’s urban landscape.

The interiors of City Hall and The Prince (standing in for the Brown Derby) are opulent spaces that lack views of the outside world, conveying a place where power is centralized behind closed doors. LA’s ill-fated water commissioner lives in a Pasadena mansion fronted by a rolling green lawn, instantly signifying his corruption in a city supposedly afflicted by a water shortage.

That visual language of conspiracy was updated two decades later in L.A. Confidential, which set its sights on Hollywood itself. The neon lights of Hollywood Boulevard are a garish distraction from the predatory world of gangsters and crooked cops who run the town.

The film’s most famous architectural star is Richard Neutra’s Lovell Health House, which plays the residence of a high-class pimp. The home’s elegant design influenced a generation of modernist architects, but in the film its glass walls suggest a voyeuristic lifestyle. The minimalist interior spaces are a front for lustful excesses going on behind the scenes.

Bright and well-ordered, the house stands in stark contrast to the tiny bungalows and seedy motels where the film’s less well-to-do characters congregate.

David Lynch presents even more disturbing visions of Los Angeles in Lost Highway and Mulholland Drive—two tangled, hypnotic films that borrow heavily from film noir conventions.

Though the films are both set in contemporary LA, Lynch stages much of the action in locations that suggest bygone eras.

As in Chinatown and In a Lonely Place, cozy courtyard apartments conceal illicit romances—and murder—in Mulholland Drive. A midcentury auto shop is the site of a fateful meeting between a mechanic and a gangster in Lost Highway. And Mulholland Drive’s most terrifying—and inexplicable—scene takes place in a Googie-style diner

Familiar locations like these—both to LA residents and those who’ve seen the city through the movies—enhance the dream-like quality of Lynch’s films. Doomed characters meander their way through surreal landscapes that seem strangely familiar.

It works because, as a genre, noir helped to define LA’s urban landscape, at least on screen. Its dark shadows found a natural home in a place where the sun always seems to be shining.