The rise of superhero movies over the last two decades has been fueled in large part by the explosion in CGI. Visual effects have shattered all conventional physical boundaries and notions of reality, helping comic book favorites achieve impossible tasks in improbable places. But removing the human limits sometimes risks stripping stories of their human element, a danger especially pronounced when the titular superhero isn't yet all that super.

Such was the challenge faced by the effects teams that worked on Spider-Man: Homecoming. Because the quasi-reboot follows a young Peter Parker's early uncertain adventures as the webslinger, director Jon Watts' movie needed to portray the high school hero as more unbalanced than balletic.

"The mandate from Marvel and the other creative people on the shows was that they really wanted to keep the story grounded and a lot more relatable for this particular rendition of Spider-Man," Theo Bialek, the VFX supervisor for Sony Imageworks' contribution to the movie, told SYFY WIRE. "That gave us the permission to be a little more conservative with the actions."

Conservative in this case meant creating physical flaws and missteps. "People don't have the benefit of thinking about every fraction of a second that they're moving, so you might stumble, or your balance might be off, or your knee might kind of flare out," Bialek said.

Ironically, that proved more difficult in many ways than animating the most fantastic superpowers and earth-shattering battles. In a perfect world, they could have just added some wobbly knees, ankle rolls, and foot trips to the animated Spider-Man, but as Bialek explained, "when you just try to add stuff, which we call 'dirty up the performance,' it feels like it's been augmented, and it's not natural."

Video of U0D3AOldjMU

Tom Holland to the rescue

It was well-documented during the run-up to the movie's release that star Tom Holland's natural gymnastic skills allowed for both extensive motion capture and general inspiration for Spider-Man's acrobatics. But the inevitable little flaws in his movements and mistakes he made during stunt work were also incredibly helpful to the VFX animators charged with designing Spider-Man's acrobatics.

"We would look at the outtakes, the stuff in between the motion captures when he still has the suit on, and at the video reference where he's not actually performing, but when he leans and puts his weight on one side, and you see how his weight goes out," Bialek said. "The puzzle is trying to find locations in our performances where we can fit that in and it doesn't feel forced."

A battle with The Vulture (Michael Keaton) in a warehouse provides an instructive example of how they had to work hard to scale back the effects they might usually create for a fight scene. The villain sends the world's deadliest hoverboard after the young hero, chasing him all around the industrial space.

"When the character jumps up on top of the wings as it flies by, we had him doing flips and a lot more acrobatic things like that and it just didn't feel real," Bialek explained. "You also realize he's a kid and he never planned this out. This is happening really fast. He wouldn't try to do something fancy. He would just be trying to survive."

Bialek estimates that they went through 30 to 40 different iterations of the sequence and the moves that Parker might pull off while under duress. They found some inspiration in videos of people who jump over cars as they come racing toward them, an insane niche of stunt performance that nonetheless provided insight into how one readies their stance before jumping up in the air.

Similarly, they had to continually slow down The Vulture's movements in that scene, given the fact that the character was less a supervillain than a working class guy just learning to navigate new powers and equipment.

Video of SPIDER-MAN: HOMECOMING - Animating Spider-Man

Spider-Man can't fly

Imageworks also handled the effects on the sequence in which Spider-Man holds on to dear life to the hijacked DODC cargo plane. That scene required more suspension of disbelief, but even within that context, the VFX team worked to highlight young Parker's youthful inexperience and physical desperation.

They looked at people who fly with jetpacks, though there isn't all that much reference material; it mostly came from videos made by a Dubai-based company that has done some well-publicized jetpack flights with Emirates airlines. Then they looked at people who fly in squirrel suits, so that they could note the "micro-corrections" they made to their bodies in the air. And of course, because there is no limit to mankind's willingness to tempt death, the team found people who stand atop planes mid-flight, though they're much smaller and slower planes (pssh, amateurs).

The footage of Tom Cruise hanging on the wing of a cargo plane in the fifth Mission: Impossible movie was useful, inasmuch as it showed how someone reacts to extreme wind, even if Cruise was attached by a cord to the wing (pssh, amateur). And in the end, they had to fudge the truth, because the reality would have made for a very short, and very uneventful, scene. So they toned the wind effect down, and played up the danger — while keeping their hero clothed.

"What would really happen is his sweatpants would slip off his body because the wind forces would take it off, and we can't do that," he said, laughing. "We can't have the wind react as violently as it really would, because then you wouldn't see much action. So, you have to basically just go with real and then you pare it down so it's digestible to the viewer and still keeps the story interesting. So, what you have, is a derivative of reality, which is really all superhero movies are, right?"

Then there are the small details that only aviation experts might find irksome. In the movie, when the plane takes damage, it reacts violently, tossing Spider-Man around and making his grip on the thing even more endangered. The VFX team knew that was a bit of a stretch, because a transport aircraft pilot who just so happened to be on the crew told them that these advanced aircrafts now boast failsafes that keep the planes flying smooth and steady in the event that one of the engines blows out. But without turbulence, the stakes don't get raised, so in this case, they made things even more extreme than real life.

Credit: Sony Pictures ImageWorks

Homemade costume, automated effects

When Parker is up on the plane, he's not wearing his form-fitting Spider-Man suit. Instead, he's reverted to the homemade sweatsuit and hoodie that he wore early on in the film. They aren't used to animating that sort of material in superhero movies, which are packed with ripped men and women in skintight uniforms. Cloth provides a lot more variables — it certainly reacts to wind in different ways — which necessitated more attention early on during the VFX building phase of the production.

They had to build simulations to dictate the way the cloth would move, and build controls to keep Peter's hoodie from flying in his face when he was out of his costume. Eventually, that helped hasten the process, though they still had to build a skeleton beneath that clothing.

"If you have a tight suit, it's a little bit easier to rig that in the beginning, but then, once you're in the shot and he bends his arm up, you really notice the definition on his lats and his deltoids and you pick into the subtleties and then you have to spend the time in the shot correcting that," he said of traditional, muscular superheroes. "We spent more time with his cloth, more time up front, but then it pays off in the end and it hides all the other bits that you would normally have to have a lot of secondary motion added."

Though algorithms operate on formulas and mathematics, obviously, there is no strict science to making a movie's effects look believable.

"If I find myself thinking about these things, then I've been pulled out of the story. It depends action-wise what has led up to the moment," Bialek said. "What's happening? What's happened in the story previously? What has he already done? As long as it has a flow where you're not all of a sudden noticing that he's doing something, then you've succeeded. If you find yourself thinking, 'Well, wait a minute. He's a superhero. Why didn't he just jump higher?,' then we broke it."

Spider-Man: Homecoming is now available on Blu-ray and DVD.