Ice Cube and Dr. Dre watched from directors’ chairs as Compton circa 1991 unfolded before their eyes. In a parking lot behind an old, dilapidated theater in Leimert Park, low-rider Impalas hopped, Jheri curl hairdos glistened and Daryl Gates-era LAPD officers harassed. The area had been transformed into the South-Central of their youth.

It was all in service of “Straight Outta Compton,” the N.W.A biopic named for the polarizing rap group’s breakthrough record and co-produced by its founding members Dre (aka Andre Young) and Cube (O’Shea Jackson).

Locals watched as they shot a key scene in which Ice Cube, played by his real-life son, O’Shea Jackson Jr., leaves the embattled group to embark on his own uncertain solo career. A few onlookers who lined a fence around the lot called out names of the characters they recognized from N.W.A’s vivid past.

“Suge!” said one woman, calling out to the burly actor (R. Marcos Taylor) playing the terror-inducing head of Death Row Records, Marion “Suge” Knight. The actor responded in a way that would be out of character for Knight – he waved.

“I’m never gonna get used to this,” said Dr. Dre, 50, as Corey Hawkins, the young actor portraying him in the film, walked by sporting an L.A. Raiders jersey. “It’s weird, reliving it all again.”

Audiences are reliving the beginnings of gangsta rap as well through the highly anticipated and likely controversial film, which opened Friday. Directed by F. Gary Gray (“Friday,” “The Negotiator”), the Universal Pictures release chronicles the journey of the five young men as they changed the face of rap – and pop culture – on the power of one very raw, very bold album.

The story follows N.W.A from its scrappy beginnings in the mid-’80s to its unlikely success to the death of core member Eazy-E (aka Eric Wright) in 1995 from complications due to AIDS. “If you listen to their music closely, a lot of what they wrote was really visual,” says Gray, 46, who also grew up in South L.A. “You can see it. You experience it as opposed to just listening. Now to see it on the big screen – it’s just a natural progression.”

N.W.A’s music emerged before the riots and the videotaped beating of Rodney King by police, providing a snapshot of an L.A. rarely seen by outsiders. Though the crack cocaine epidemic they rapped about was a nationwide scourge, the other elements that influenced their sound – drive-bys shootings, Crips and Bloods, a militarized police force with battering rams (tank-like vehicles the LAPD used to tear down suspected crack dens) – were strictly L.A.

“Straight Outta Compton” may be a period film, but it hits at issues right out of today’s headlines, particularly the treatment of minorities at the hands of law enforcement. And given the current, post-Ferguson news cycle, it’s perhaps no coincidence that South L.A. hip-hop culture is once again permeating the larger world of entertainment.

Compton rap artists Kendrick Lamar and YG have contributed two of the most critically acclaimed albums of the last year. The hip-hop-referencing “Dope,” a small film based in Inglewood (where its director grew up), garnered major attention when it was released a few months ago. The partial reunion of N.W.A was the most talked-about show among many high-profile sets at the recent BET Experience festival downtown.

“When we were working on the script, it had to chronicle issues of the day, what we were up against, what forged N.W.A,” said an animated Ice Cube later in a trailer a few miles from the location of the shoot.

Much like his rap persona onstage or his characters in films like “Friday,” the 46-year-old screenwriter and actor filled the room with a booming voice and gregarious presence.

Seated next to him was the relatively stoic Dr. Dre, arguably the world’s most successful rap producer, the creative force behind talent such as Snoop Dogg, Eminem and 50 Cent and the brilliant businessman whose Beats headphones your kids beg for each birthday.

As Ice Cube spoke, Dr. Dre’s attention was divided between his former band mate and a reality forensics show playing on a nearby TV. “Whether it was money, gangbanging, crack, LAPD and eventually AIDS – everything in the world came down on this group,” Ice Cube continued. “What did we combat all that with? We had music. We had lyrics. We had hip-hop.”

Dr. Dre then pointed out that all of this, the whole N.W.A story, “stems from an album created in six weeks for 30 Gs.” And in Torrance, no less.

Asked if a story like theirs could ever happen today, Dr. Dre was quick to respond: “Hell no.”

GANGSTA REALITY

Known as reality rap in the days before iPods and file sharing, N.W.A’s raw style on songs like “(Expletive) tha Police” and “Gangsta, Gangsta” stood out against the more polished party rap coming from the East Coast. Eventually they’d popularize a style that would go on to be called gangsta rap. For better or worse, the sub-genre grew to influence everything in hip-hop that came after it.

“Some people say gangsta rap has this bad kind of effect on people, but N.W.A clawed their way out of a negative situation,” said Gray, who has worked on videos and films with various N.W.A members over the years. “They created music, movies. For some of us, it inspired us to go out and do our thing. None of us have a degree in anything, but we learned a lot from our environment and they’re a testament to following your vision.”

Back on the set in Leimert Park, Ice Cube and Dr. Dre watched the monitors closely, weighing in on details (hubcaps, ball caps) to “get it right.” Other members of the old group also stopped by, such as DJ Yella and MC Ren. The veteran rap stars have been on and off the set throughout the production.

“Straight Outta Compton” stars a largely unknown cast aside from Paul Giamatti, who portrays the band’s former manager Jerry Heller (his character plays a pivotal role in the group’s eventual demise). Casting relative unknowns was intentional, as Ice Cube explained, because he didn’t want anyone who already had a reputation “or was on TMZ” taking away from the story.

Becoming N.W.A was a daunting task for the young actors, especially Hawkins. He had to become the hard-to-read, somewhat intimidating Dr. Dre. “Initially, when I heard about it, I was like nah, no way,” said Hawkins, 26. “It’s Dr. Dre. I don’t look or sound like him. I was checking off every reason why I shouldn’t take on this role.”

Jason Mitchell plays the complicated Eazy-E, a central figure who funded the band’s first record with drug money, rapped some of its most notorious lines and founded Ruthless Records.

The main cast, who also include Aldis Hodge as MC Ren and Neil Brown Jr. as DJ Yella, had a full-time coach in veteran West Coast rapper WC. He taught them how to look, act and sound like 1980s South L.A.

“He would constantly tell us to stand up straight,” says Mitchell, 28, of the performance scenes they shot. “My generation have this kind of diddybop style, where we [crouch] down really low to the crowd when we’re rapping. They didn’t do that back then. He kept saying, ‘Make sure you stand up and keep your shoulders real broad – remember that N.W.A taught the world how to be cool.'”

Eazy-E’s widow, Tomica Woods-Wright, co-produced the film, and the late rapper’s son Lil Eazy made himself available on set and by phone to lend support, said Mitchell.

It wasn’t easy, however, getting the film off the ground, even though Ice Cube was motivated to do so when he heard Heller was planning on making his own N.W.A biopic. The production went through various phases, from talks with director John Singleton (“Boyz n the Hood”) to its early development with New Line Cinema. In the end, “Straight Outta Compton” took 13 years, several script revisions and cost a reported $29 million.

Today Dr. Dre credits Ice Cube for seeing “Straight Outta Compton” from a vision to a reality. “I don’t live my life in the rearview mirror,” said Dr. Dre. “I always look forward, so it took a while for me to go back and remember a lot of things that happened in my life, the timelines. It was difficult for me.”

“I knew where we should start this movie and where we should end it,” said Cube. “I knew before we even started the film because I’m always thinking about the journey that got us to this point.”

LAW ON THE STREETS

A few days later at another shoot for the film, the crew and about 200 extras were re-creating a pivotal Detroit show at the Los Angeles Sports Arena. In the scene, N.W.A is told by Michigan authorities not to play “F – tha Police” or the show will be shut down and the band arrested.

Ice Cube’s elderly parents sat offstage, watching the scene on monitors. They bobbed their heads as Jackson Jr. rapped lyrics no grandparent should ever hear.

“I’ve tried to be straight with my kids about our past,” said Ice Cube, whose son is reliving all those raw years for the film. “My wife and I tell them a little bit at a time, and when it’s age appropriate. He’s now in his 20s.”

His son said, “I know the back story beyond the movie. I’ve heard all the stories over the years from him, but now I feel the pressure he felt to be making these heavy decisions. It’s extremely important to take it seriously.”

“Straight Outta Compton” received unwanted publicity in January when art and reality collided in the form of the real Knight. Though he co-founded Death Row Records with Dr. Dre, Knight’s brutal business tactics (portrayed in the film as him threatening bodily harm and worse to those who got in his way) eventually caused the two to part ways.

Earlier this year Knight, then 49, tried to drive onto a Compton set where a commercial for the film was being shot. After he was turned away by security, Knight drove to another location where an altercation ensued. He is accused of running over two men with his truck, killing one of them. He has since been charged with murder. Knight has pleaded not guilty to the murder charge.

No one involved in “Straight Outta Compton” would go into detail about dealings with Knight during the production. Gray says they did their best to tell the story as accurately as possible.

The authenticity of N.W.A’s story in “Straight Outta Compton” is sure to be picked apart by rap aficionados, but as rap biopics go, it’s the closest Hollywood gets to hitting the mark. The film, like N.W.A’s music, is not kind to women. Party scenes are laden with countless naked groupies who appear to have far less value than the group’s ever-present cache of weapons. The film portrays ample drug use, and plenty of shady business dealings, largely at the hands of Heller.

But it’s the film’s depiction of police brutality, and the tense dynamic between law enforcement and the urban neighborhoods they patrol, that makes it so topical. Scenes of the men’s harassment by police, and the building rage that led to the L.A. riots, feel prescient given the recurring national episodes of unarmed blacks being killed by law enforcement.

“The film is timely, and that’s sad,” said Gray, who began the film before Ferguson, Mo., erupted. “The more things change, the more they stay the same. Dealing with brutality on that sort of level, we hoped that would have changed by now.”