Avengers: Infinity War has one of the most shocking endings ever seen in a superhero movie. But what exactly is going on with the villainous Thanos?

Spoiler warning: We've steered clear of discussing the story in detail, but this article is about a scene at the end of the movie. If you haven't seen the film, bookmark this and come back later!

Composite by Aaron Robinson/CNET

At the devastating climax of the box office-smashing Avengers: Infinity War, the giant purple alien Thanos achieves his goal of collecting the final Infinity Gem. With a snap of his fingers, he wipes out half the population of the universe, including several of our heroes.

But as the heroes begin to disappear from Wakanda, Thanos finds himself somewhere else. In a hallucinatory realm, he meets his daughter Gamora as a child and faces the personal cost of his mad achievement. But where is this otherworldly location?

The visual effects company in charge of creating Thanos for most of the film was Digital Domain. I spoke to Kelly Port, visual effects supervisor for the company's work on Infinity War, to find out how the team created Thanos and what's behind the strange realm known as "The Waystation."

Was it a lot of pressure to create the character anchoring the whole movie?

Port: Yeah. [Laughs.] Marvel engaged us quite early on, a few months before the live-action shoot started, to do a test, both Weta and Digital Domain kind of co-developing the character. We had Josh Brolin come in to Atlanta to talk with the directors and talk about the character a little bit. He was in the helmet-cam and the motion capture and we were able to extract out some test material, three or four shots put together to help sell the technique we were using. Once we put that test together and got that in front of Marvel a few months later I think there was a big sigh of relief, because as you say the film centers on Thanos. He's got 40-plus minutes of screen time. It was really critical Josh Brolin's performance came through with as much fidelity as technically possible.

Thanos has a huge range of emotion, from raging to almost tender. Was it a challenge to depict that range?

Yes, but it was really fun for us too. We all had a really amazing time with this character because it was such a rich and complex character. As evil and villainous as he is, people are maybe not sympathizing with him but at least understanding where he's coming from.

Most of our sequences were these heavy dramatic close-ups and not a lot of action, except for probably the very opening scene on the Ark where he fights the Hulk. The animators had a blast doing that. And then, of course, at the end in Wakanda, and all the way to when he snaps his fingers and then he goes into what was called The Waystation, where he meets Gamora, and it's that dreamlike atmosphere with the red water and pinkish, reddish skies. I just loved that sequence. That had some of the best subtle performances from Brolin. That's exactly the kind of stuff we knew we needed to be able to capture from his performance.

Marvel Studios

Can you tell us more about the Waystation? Is that in Thanos' mind, or somewhere else?

I certainly haven't been told this by Marvel or anybody, but I think it's in his mind. It's not a physical place, it's not a memory, even. I think we want to keep it kind of open to interpretation. I think the meat of it is Thanos in his mind connecting with his daughter. It just seems like an internal moment of reflection. It's this really nice dramatic pause at basically the culmination of 10 years of storytelling, right? It's this moment where he can just have this moment to internally reflect on what he's done and the cost of that decision.

It went back and forth in terms of what that environment looks like, through quite a few different iterations. It was sort of like as if he was being a part of one of the stones. You can see a little bit of crystal-like faceting back there. It wasn't quite like a real-world sky. It had some interesting shadows in it.

It's so powerful that the whole film has been filled with big fights and explosions, then at the end there's a devastating moment of silence.

Yeah. And then we did the last two shots of Thanos. We don't know where that is -- I wasn't told -- but it was some other planet. He's sort of become a farmer basically. [Laughs.] He just sits down and has sort of a sadness, but a smile, almost like a sense of contentment or satisfaction.

I've heard different people interpret that differently, which is interesting. It's so fun to read all the different interpretations. We've been working on this and holding all these secrets for so long, I really get a kick out of people just getting so excited about it and trying to make sense of whether he's smiling or is he sad or is it a combination of both...

Marvel Studios

What do you think?

So what is the mysterious Waystation? Port certainly thinks it's in Thanos' mind, but it could also be inside the Infinity Stones.

It's also not clear whether it's just a name used behind the scenes or whether that name will be confirmed on screen at a later date. Digital Domain has yet to start work on the Avengers sequel, so Port couldn't answer whether we'd see the strange realm again. But we might return there in the next film -- and if we do, will we see Gamora, somehow trapped between dimensions, with the potential for resurrection? Get your fan theory hats on, everyone.

How to watch every MCU property in the perfect order: From Marvel films to the shows on Netflix, here's the best order to experience the MCU.

Why the Marvel Cinematic Universe was a huge risk: As Black Panther and Avengers: Infinity War smash box office records, it's strange to think Marvel's movies were a gamble 10 years ago.