The special effects that power the sci-fi blockbuster "Interstellar" are helping researchers better understand supermassive black holes and other real-world cosmic phenomena.

The "Interstellar" visual-effects crew has published a scientific study describing the computer code that brought to life the wormhole and enormous black hole, dubbed "Gargantua," that played central roles in the film.

The study, which came out today (Feb. 13) in the journal Classical and Quantum Gravity, details how the computer code — called Double Negative Gravitational Renderer, or DNGR — helped construct a scientifically accurate view of Gargantua, by mapping out how millions of light beams travel through the warped space-time surrounding the black hole. [The Science of 'Interstellar' Explained (Infographic)]

The "Interstellar" team discovered early on that the traditional way to create an onscreen black hole produced an odd flickering as stars and other objects moved about. So they tried something new.

"To get rid of the flickering and produce realistically smooth pictures for the movie, we changed our code in a manner that has never been done before," study lead author Oliver James, chief scientist at England-based special effects firm Double Negative, said in a statement. "Instead of tracing the paths of individual light rays using Einstein’s equations — one per pixel — we traced the distorted paths and shapes of light beams."

‪"This new approach to making images will be of great value to astrophysicists like me," said co-author Kip Thorne, a renowned astrophysicist who served as an adviser and executive producer of the film. "We, too, need smooth images."

James, Thorne and their colleagues also used DNGR to better understand how strange, crinkly space-time surfaces called "caustics" affect images of distant stars as seen by a camera or observer close to a fast-spinning black hole.

"A light beam emitted from any point on a caustic surface gets focused by the black hole into a bright cusp of light at a given point," James said.

"All of the caustics, except one, wrap around the sky many times when the camera is close to the black hole," he added. "This sky-wrapping is caused by the black hole’s spin, dragging space into a whirling motion around itself like the air in a whirling tornado, and stretching the caustics around the black hole many times."

You can read the new paper for free here.

"Interstellar," which was released in November 2014, centers on a small band of explorers that sets out to find a new home for humanity, whose existence on Earth is threatened by global crop failures. This crew, led by a former farmer named Cooper, journeys to another galaxy via a wormhole that mysteriously appeared near Saturn. (The effects team used DNGR to visualize the wormhole as well.)

The film was directed by Christopher Nolan, and it stars Matthew McConaughey, Anne Hathaway, Jessica Chastain and Michael Caine.

Follow Mike Wall on Twitter @michaeldwall and Google+. Follow us @Spacedotcom, Facebook or Google+. Originally published on Space.com.