Creating a VFX Explosion in UE4

Gasper Znoj shared an extensive breakdown of the VFX project the artist worked on, talked about sources of inspiration, and explained how to combat challenges along the way.

Introduction

Hi, I'm Gasper Znoj and I'm a VFX Artist from Ljubljana, Slovenia. I graduated from Institute and Academy for Multimedia (IAM) with a major in 3D animation. While studying I started making small game prototypes in Unity and that got me interested in games. Because there were no video game diplomas/courses in Slovenia at the time I decided to move to Vancouver to study Game Art & Design at VanArts. After finishing my degree I have worked on Plants vs. Zombies: Battle for Neighborville (EA), Age of Empires IV (Relic Entertainment), and Dauntless (Phoenix Labs).

Inspiration

My inspiration for the effect was @quentincordonn1 explosions for Runeterra cinematic trailer. When I saw this tweet I wanted to try to achieve something similar using meshes. A while ago I was working on a puzzle/adventure game prototype and I was exploring the cel-shaded materials. Those materials gave me an idea of how I could create this effect.

Go follow Quentin if you haven't already, his work is incredible!

Workflow

I made two shapes for this explosion – the sphere and smoke trail (making more custom meshes would make the explosion look better). The sphere was pretty straightforward. I created a simple sphere in Maya and pulled out some vertices with soft select to make it more interesting.

I could have done the same thing for the smoke trail but making organic shapes is much faster in ZBrush. I started with a DynaMesh sphere and used Move and Standard brush to make the smoke trail. After that, I ZRemeshed it to make it low poly. I didn't need a high poly because I'm not using any normal maps for the meshes. I imported smoke trail mesh in Maya and added a bit of a curve deform >nonlinear >bend.

I broke down this shader into the base elements to show how it works:

I really like how this works because you can add, multiply, mask your texture (in 2D space) and then it projects on the mesh. The texture I'm using is 1px x 512px. So if you panned the texture up or down it will pan towards or away from the light direction on the mesh. In this way, you can add highlights or anything you want. As long as you also connect the same result of the dot product in any other textures you are adding. It's similar to Substance Designer where you connect your graph in Cartesian to Polar and you can tweak your texture however you want and see the result in Polar coordinates in real-time.

On the top left, you can see I'm getting a dot product between a custom vector that I'm setting manually (light direction) and vertex normal direction of the meshes. This allows me to rotate the highlight of the smoke in any direction I want. Normally you would replace that with a Material Parameter Collection with a custom parameter that has the main light (sun) position like so:

This will adjust the highlights on all explosions that are using this shader to be facing your main light (sun) position. While this might be something that you want because it's more realistic and makes sense (in a third-person game) I think it looks better to use the position of the camera (with an offset) for the light direction. This would make the explosion look the same from any angle (I have not set this up yet but I will in the future). It's the same with 2D animated flipbooks because they have drawn highlights and shadows.

The distortion comment section is pretty simple. It uses a Normal Map to distort the texture I'm using. I have also added a Normal Map mask so I don't get weird results on the top and bottom of the sphere.

This last one is the final shader I used for the green smoke explosion effect:

Challenges

There's a couple of challenges when making an effect this way. The first one is blending the smoke meshes together. You can get some hard lines or weird results. This could be solved by blending vertex normals of multiple overlapping meshes based on a distance mask. I have not tried this before because I have not found a good way yet. Another challenge is performance. It's not the best to have all of your smoke in the game be mesh particles.

I think what makes this kind of effect appealing is the anime explosion look. It also provides real, accurate shadows and the most important thing – volume. This effect works really well for a third-person game where an effect has to cover a large area (or a player) with smoke for a longer time. Even though this effect can still be improved I can already see a huge potential in this workflow.

Gasper Znoj, VFX Artist

Interview conducted by Arti Sergeev

Join discussion

Comments 0

    You might also like

    We need your consent

    We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more