Code that Lights Up Your Favorite Animated Film

Many of my favorite movies — as a kid and now as an adult — are animated. Over the past few years the visual effects in these movies are increasingly more sophisticated, including the lighting in Brave, photo realism of a city in Big Hero 6, and the immersive world and aerial stunts in How to Train Your Dragon 2.

Often, I can get so wrapped up in the story and the visuals that I overlook the massive amount of work that goes into making each one. For filmmakers, that’s probably the point. Consider though that a typical Pixar animation takes four to five years to complete, dozens of specialized teams and numerous lines of code.

Where does the code come into play for a computer-animated film? According to Danielle Feinberg at Pixar Animation Studios, there are actually millions of things you can do with code in animation. You could use code to make a leaf flutter, to make schools of fish, and to make a giant head of red curly hair (like Merida’s!) that moves appropriately with the character.

Animation programmers and engineers write the code that makes what is artificial seem real. Highly skilled engineers also design the tools that animators use to do the designing. Pixar actually built its own in-house rendering software called RenderMan that its teams use for all Pixar films.

RenderMan fleshes out animation to make it more realistic with interactive lighting and shading. Other computer graphic-heavy movies like Guardians of the Galaxy and Captain America: The Winter Solider also used RenderMan, now considered the industry standard for special effects.

Lighting in "Brave"

Lighting is crucial in animation. It brings things to life – from background scenes to a character’s face. Danielle worked on one of my favorite Pixar films – Brave. As the director of Photography for Lighting, she works to determine the look and feel of an animated scene using lighting, but underneath all the lights that she places in a scene are thousands of lines of code.

At the launch party last year for Made with Code, a Google initiative to encourage interest in computer science, Danielle shares the story of her experience lighting Brave. One day the computer “choked” on her during the development of the lighting style, however she ended up loving the end result — a dark forest — anyway and sold the idea to the director. A reminder that sometimes a flub can work out for the best.

Danielle Feinberg inspires girls to follow their own voice.

Software pushes what’s possible

Pixar is not the only animation house to design its own tools for lighting effects. Disney Animation, which released last year’s Big Hero 6, developed Hyperion, software that simulates the physics of light. It all sprang up from a desire to make the film’s futuristic city San Fransokyo as realistic as possible. With a shimmering bay, towering skyscrapers and pulsing neon lights, the Hyperion effects paid off.

The inception of Hyperion by Disney software engineer Brent Burley and its 2.5-year development is detailed in an LA Times story on Big Hero 6.

For Disney Animation, the process of rendering light was tedious before Hyperion because each ray of light’s trajectory had to be individually tracked. A single frame of animation could contain several light sources, and each ray of light could bounce off multiple surfaces, making the calculation of those individual pathways a computational challenge.

Burley posited that organizing large groups of light rays into bundles would allow a computer system to more efficiently handle calculations of their trajectories. By doing this, a film could feature more lighting sources and add nuance to their depiction. He presented his theory to Disney Animation executives in November 2011, and they were encouraged.

In today’s animated films, math, precise engineering and code come together to create characters and worlds that enchant us. So, the next time you see a family of dragons fly over the ocean on film, like in the upcoming How to Train Your Dragon 3!, consider the advancements programming is taking 3D animation.

Image sources: Disney