One of the unshakable rules of Hollywood in recent years has been that as much as stars want to work in Los Angeles, they can’t turn the tide against the lure of runaway production.

But every now and again there’s an exception. That could be true of Billy Ray’s remake of crime thriller “The Secret in Their Eyes,” in which Julia Roberts stars alongside Chiwetel Ejiofor and Gwyneth Paltrow. After Roberts came onboard last month, the original plan to start production early next year in Boston was scrapped, and the shoot shifted to L.A. — with no official explanation why.

But a good incentive can be as effective as a star’s whim. Matthew Modine, who has more than 60 credits, says he’s never been able to persuade a producer to pick California. “It always falls on deaf ears,” he notes.

That changed a few months ago when Modine’s directorial debut, coming-of-age drama “The Rocking Horsemen,” received notification that the state had selected the $3.27 million project for a 25% tax credit.

Modine says he could not have shot “Horsemen,” set in the summer of 1962 and centered on five teens forming a band, anywhere but California. “The Atlantic is nice, but it’s not the Pacific,” he notes. “I need big beaches and big sky. I go to streets in Burbank, Culver City, Venice, and they are just like they were  in 1962.”

Jake Gyllenhaal had a similar experience with “Nighcrawler,” which debuted last month at the Toronto Film Festival. A year ago, it was selected from the wait list to receive a $2.3 million allocation from the California Film Tax Credit program. Producer David Lancaster says that decision led to the entire film being shot in Los Angeles — its actual setting.

“There are not too many places where you can shoot this story about newsgathering in L.A., but without the credit, we would have just done establishing shots, and then shot either in Shreveport or New Mexico,” Lancaster admits. “We had an alternative budget on both, and they would have cost less than California if we had not gotten the credit here.”

Modine was a keynote speaker this summer along with Danny DeVito at the California Film Commission’s locations conference to rally support for increasing the state’s tax credit program. He elicited laughs from the crowd by quipping that Vancouver was planning to host the Oscars, and that Louisiana had bought the Hollywood sign.

In August, Gov. Jerry Brown and the state legislature reached a deal to expand the California program from $100 million to $330 million per year, starting next July, and lasting five years. Modine says California thesps are ready to stay home.

“When they passed the legislation, it was such a sigh of relief for actors,” he added. “I’m so happy about it. The state will get its money back tenfold from this.”