top of page

Recreating some of the VFX from Avengers: Infinity War in UE4

Hi Everyone, I’m Richard, a baby real time VFX artist. I’ve been building effects for game engines for about 5 months now. I’ve got a good grasp of all the fundamentals but found that I’m at a point now where I need to step up my game. That is why I’m starting this blog. From now until I inevitably forget this exits and stop updating it, I’m going to be delving into various effects I think are cool and deconstructing them.


Avengers Infinity War was a beautiful movie. I can’t think of anything more stunning than the Thanos vs Dr strange fight scene on Titan. The folks who worked on that did an incredible job and I am so glad Dr Strange is going in more movies because this will not be the first time, I steal ideas heavily draw inspiration from that character’s spells. These last couple weeks I’ve been recreating 3 of the spells from that fight scene and this blog is going to talk about my working process of adapting these effects from a movie to a game in the Unreal Engine.


This week we’re going to be looking at:

1. Gathering Reference

2. The functionality Pass

3. The shape and Value Pass

4. The colour and Final Tweaks Pass


I just want to start off by saying that everyone has different techniques, and this is not at all the definitive guide to how someone should build effects. Chances are next month this won’t even be the way I build effects anymore. As we get better, we’re going to find new ways of doing things and processes we can drop for something faster.

1. Gathering Reference

The first step to every project should be gathering reference for what you want to create. For this project the step was easy I was copying a movie, so it was case of making a ton of notes about how things look, what movement happens, and what material features I’d need to make.

I downloaded the clip I was looking at from online and turned it into smaller gifs of the effects I wanted to do. I also took some screenshots from the video and arranged them on a mood board using PureRef. PureRef is great for mood boards it’s easy to drag images onto it and you can set it so it is always the top window which is something I’ve been looking for for a long time.

Once you have the reference you need you can dissect the effect and build up a requirements list.

For the Purple bolt:

I need these particle systems:

Muzzle flash, Projectile, Impact

Which need these emitters:

Muzzle Flash:

Flash mesh emitter, Flash light Emitter

Projectile:

Glow point, Ribbon guiders, Ribbons, Sparks traveling off the glow point

Impact:

Ribbon bolts launching off, large flash point

This list forms the minimum viable product for the effect. This is the foundation we’re looking to build up too.

2. The Functionality Pass

The functionality pass is essentially my version of the block out for an environment or making rough poses for an animation. The Goal is to make the effects work through code/blueprints. I make some block out particle systems and use basic shaders to build a rough idea of what everything will look like. This project was setup as a fight between two characters. To make it work I used one all encompassing blue print to launch the effects.


It contains two placeholder models to represent our duelling space wizards and two arrows pointing at each other.

I split the node graph into 4 sections and made comments on what each graph is meant to do.

Inside each box an event is triggered from a key press. That event spawns a particle emitter that starts the effect and then an actor that acts as either something static or a projectile depending on the effect. This isn’t the cleanest way to work but I like to split the transform struct pin into the core components, so I didn’t need to use extra nodes. The blueprints aren’t the cleanest and in a real production environment a programmer would swat my nose with a rolled-up newspaper. Luckily with personal projects you can make your graphs as messy as you want and the only people that will ever see them is the 100+ people reading the blog you write about it. (It was 400+ for the last one, Humble Brag) Within each of the sub actors that get spawned there is some basic logic that dictates what the effect does.

For the shield, it spawns and then despawns after 2 seconds. When it gets hit by something it destroys the main shield effect and spawns the exploding effect.

For the black hole projectile when it begins play it stops the actor from moving uses a timeline to scale it up then sets the velocity to 500 and after a while uses another timeline to shrink it into nothing and destroy it.

This is also the stage where I make any simulations for destructions.

This Mirror wall was simulated in Houdini before being imported into UE4. Unfortunately, due to some UVing issues with Houdini sims this one had to be cut from this project.


The end result of my functionality pass yielded 4 blocked out effects. Thanos’ two offensive spells the bolt and the black hole and Dr Strange’s two defensive spells. The mirror wall and the shield that turns things into butterflies.



3. The Shape and Value Pass


The main goal of this pass is to further define the shape of the effect then to define the brightness values. The Values meaning how bright it is in some areas and how dull it is in others, skipping this step and going straight to colours makes it very easy for the effects to suffer from over brightness. You can see this happening in the bolt from the functionality pass. Every shader is using a bright purple with a value of 30. This makes the effect look extremely uniform and dull, this pass will be made in greyscale and colours will be added later once those values are spot on. To start the pass off we take our reference imagery and make it greyscale. From there we look at what kind of materials and where our bright points are and what kind of movement is going on.


For our purple bolts the ribbons are brightest when clustered together which means we need an additive shader. Our glow point goes from being oblong to be a smaller circle to disappearing by the time the bolt hits the shield. A glow Is coming off the whole bolt, so we need a large light emitting particle in the projectile. The Impact has a sharp glow in the centre but has a heavy falloff.

Our Projectile particle setup looks like this:


We don’t look at the ins and out of cascade a lot in this blog, mainly because there’s not much unique stuff that I can cover. Once you see one Cascade tutorial you’ve seen them all that’s why my focus is often on materials. This layout Is no exception you can see the standard colour and size over life on each emitter. There are a couple things that are important to know however. The inherit parent module, this is the module you want for making projectiles. It will take the velocity of the blueprint and give that to the emitted particle. The Point Attractor module is what makes the lightning bolts flow around each other when the module is fired. It tells the bolts to orbit the Flare particle, I then attached my ribbon modules to the bolts to give the nice organic flow. The emitter has 4 shaders that are used. An embers shader that uses 2 sine waves added together to create flicking sparks. A dark flare which made from a sphere mask multiplied by a particle motion blur fade. A flickering glowing flare shader that also uses to sine waves, and a lightning shader made from a combination of a texture I made in after effects and a bloom that is made using the texture coordinate gradient trick. The dark flare and the flickering flare were built from the Grimm.exe Paragon assets I was looking at last post.

This gets us a bolt with lighter strands and darker strands. It’s also weirdly multicoloured. When I took this video, I was using a uniform colour in the initial colour that was set between 20 and 0.02 which would have been either a bright white or a dark grey. In future iterations I make this with a dynamic parameter multiplied by the function colour to control the brightness because using random colours in cascade is a bit dodgy.

The bolts impact was a direct copy of the bolt with the ribbon controller emitter being shot in random directions and the lifetime of the two flare emitters were set to a very small time. The muzzle flash is just a mesh emitter that warps the mesh using size over life. Put it all together and we have this:


The black hole by contrast was a lot duller and focused more on distortion. It had a dark core on the inside, a brighter storm swirl with lightning bolts coming off it, and refraction around it from sucking in surrounding things.


Its system looks like this:

The core emitters use the same dark flare from the bolt. The first core gives us a dark but not black base. The second core is smaller and darker. Around that there is a mesh particle which is just a sphere, this makes the effect appear more 3 dimensional. Then there are dull plasma rings with bright plasma rings over the top and refraction heavy distortion rings over that. For anyone who doesn’t know. Particle systems render from left to right, so the leftmost emitter will be at the back of the effect. To finish off the effect, I have two mesh emitters. One that shoots out splines and another that spawns a souler coaster to give the impression the black hole is sucking stuff in. Almost all the materials used in this effect were repurposed paragon materials that were rebuilt. The plasma rings are based on the fire rings material and the distortion rings are the fire rings with a height to normal node.


The black hole also had a casting effect that is just the flickering glow from the bolt growing bigger and flickering more. By the end of this stage the effect looked like this:


At this stage my version of the shield was basic It was made up of two systems. A casting system that disintegrated if it wasn’t hit by something and a destruction system that would shoot off shards and turn to butterflies if it collided with something. It also didn’t really have the values that I wanted. This effect didn’t really come into it’s own until the colour and final tweaks pass, and that’s ok. Not everything has to follow a process exactly.

During this pass the system only had two emitters, the shield which used size by life to grow and the sparks that spawned when the shield had started to erode.

The impact system had a lot more going on. It had two spark emitters one of which made an event when they die which spawns a butterfly particle. The core materials for this effect is the mandala shader that has some maths for alpha erosion set up. A butterfly shader that flaps their wings, and the paragon hotdog sparks material that has been changed around to use a particle macro UV so the sparks almost take on the shape of the mandala as it’s disintegrating.


By the end the shield looked like this:

4. The Colour and Final Tweaks Pass


The Colour pass was where I added colour to the effects and made any other final tweaks, or in the case of the shield a minor redesign.

To start it off I created material functions with all the colours I wanted to use. Since I already had my values set up in the particle system, I limited myself to a maximum value of 3 on any of the colours. My idea was to get the gradient I wanted looking right the particle systems will do the rest of the work.



In the materials what was plugged into the emissive now became the alpha for a lerp node where I would take two of these colours and blend them together.

For the Purple bolt some of the final tweaks I made was with the muzzle flash. Something about it just didn’t look right it was always either too far forwards or too far back. The way the mesh warped was good, but I couldn’t get the lifetime where I wanted it. I was able to solve this issue by adding a second flash that was thinner and didn’t get warped to the sides. This one was also much faster and had a smaller lifetime, the combination of the two allowed me to find a place where the slow muzzle flash was around long enough to cover the start of the ribbon trails and the faster flash made the projectile look like it was being fired rather than nudged.

For the black hole the final tweak that I made was increasing the spawn count of the fire rings to thicken up the shape and reducing the size of the distortion rings I also changed the PSA type on the souler coaster emitter to type specific, so it rolls around with the camera.

The shield went through some heavy renovations. The first thing I did was split the first emitter into two. I took off the size over life of the shield and made a new system with a casting animation that fired out GPU particles into a velocity grid. This gave the effect a much better sense of timing. Next, I turned down all the values on the shield. I left the colour over life at 1 and the scale over life module at 5 and that was all I needed. Once the colours were added in it looked a lot better. Finally, what I did was tweak how the butterflies were rotated. It makes them a lot more uniform now.

When everything was finalised I cleaned up the set edited some lighting and made a video of the effects.


All together this was a really fun project, and I hope you enjoyed reading about it. This post was a lot less tutorially than my last one but I’m wanting to get a lot of variety in these blogs.


Hopefully whether you are brand new RT VFX artist, or you’ve been doing it for several years there was something here that helped you out. If you do find any creative uses for the things I’ve talked about here please email me a gif at – RichardVFXfanmail@gmail.com or tweet me @stokes_richard I’d love to see what you can create.


Check back in a couple weeks where I take a trip to the beach and try to mimic the style of Rare’s Sea of Thieves.

262 views0 comments
bottom of page