Creating a Campfire VFX in UE4

Erik Forsström did a breakdown of his campfire simulation made in UE4: shaders, heat distortion, embers, realistic & stylized campfires and more.

Erik Forsström did a breakdown of his campfire simulation made in UE4: shaders, heat distortion, embers, realistic & stylized campfires and more.

Introduction

Hi! My name is Erik Forsström, 25 years old from Stockholm, Sweden. I’ve been studying various parts of the game development for a few years, both programming and 3D graphics. But the first time I started doing VFX was spring 2017, it was an extremely slow start because of lack of tutorials and I didn’t have any guidelines. Also learning VFX for the first time in Unity without a proper material editor (they didn’t have the official version they have now, only Shader Forge which I didn’t know about back then) made it even slower, and it was first in the summer I started to learn how to make VFX for real in UE4 instead.

I’ve used both Unity and UE4 quite a lot, and I don’t think it really matters which one you start with. There are a lot more tutorials for both engines these days compared to when I started and I’d say it’s mostly about preference now.

The Campfire

For the campfire, I created a total of 6 shaders, the flames, smoke, embers, heat distortion, burning wood, and last but not least fake shadows. Most of them are simple shaders with just a few textures, and some UV-distortion to get some movement in them.

Even if I say that they’re simple, it was a real struggle to figure out how to get the fire as I wanted. It was the first time I was creating a realistic fire shader and I can’t even recall how many different sorts of shader I’ve tried and failed with, but then suddenly I decided to try a less noisy noise texture with one of my better shaders and I ended up with what you can see now.

Shaders

Fire Shader

The flames are a fairly simple shader, it’s a simple mask with some distortion that gets some randomness in it from noises that masks parts of it. Something that really added a lot was a MaterialFunction from the Paragon packs, “DeriveHDRfromLDR”, I haven’t used it enough to explain exactly what it does and how it works. But it really makes a big difference for the color of the effect.

To the left of the textures are just standard UV distortion (smoke & shadows have examples of that in their images), in another word, some kind of panning noise texture that you plug into the UVs of the textures. Personally I pretty much always use cloud textures generated from Photoshop for simplicity and I like the smooth results from it.

Smoke shader

Fairly similar to the flame shader but with a more simple setup, some distortion (it’s possible to skip it but I wanted to give it a try and I liked the results) on the cloud texture and then just a simple mask to mask out the edges of the smoke.

Heat Distortion

The heat distortion (that blurs the air above the fire) is an even simpler material, you only need a normal map and a mask with soft edges to avoid visible squares and then add some refraction. Then in the particle editor, I use a curve to fade the refraction from 1.1 to 1 for some refraction that slowly fades away.

Shadow Shader

The shadow material is just a simple texture with a small bit of distortion to get some small movement to simulate that the light from the fire is moving. If you have a proper lighting setup you can most likely get a similar result without it, but I’ve barely any knowledge about lightning so this was the easiest way for me to get the result I wanted.

With & without the fake shadows:

Embers

Embers are just a using a square gradient, with cloud noise that flickers with the help of a sine curve.

The burning wood is just an emissive mask with some noise to simulate some flicker in the wood.

Particles

So finally down to the fun parts, spawning all the particles. I had a fair amount of trouble to get the particles to spawn where I wanted, so I made a very simple rig for the campfire and skinned where I wanted the particles to spawn from with the help of “Skel Vert/Surf Location” node (not really a node I suppose since I did it in Cascade, but in the lack of a better word I’ll use it for the different sub-menus of an emitter) in the particle editor. It’s very simple to make them spawn from a skeletal mesh, Unreal documentation has a short explanation of that.

This way I could get the fire to be a bit more connected to the campfire without moving around emitters, I still had to add emitters with particles not spawning from the mesh but it gave me a good base to work from.

One important thing to make the particles look like I wanted was to change the screen alignment (in the Required node in the Particle Editor) to PSA Velocity, that way they’re aligned to the direction they’re moving in.

After that it’s just a lot of playing around with values, a good tip for quite a few effects is to spawn them invisible and just fade them very quickly. That way the particles don’t pop-in from nothing, I used it for all of my different particles in this effect.

In the end, I ended up with 14 different emitters, 6 fire emitters (4 spawning from different parts of the skeletal mesh), 3 embers, 1 heat distortion, 2 smoke emitters, and 2 light emitters.

Difference Between Stylized & Realistic VFX

I’d say the biggest difference between stylized and realistic is shader work and optimization. There’s obviously some things that more or less different depending on theme etc, but overall it just requires a different mindset.

Earlier this year I made a completely different kind of campfire for a student game project where I was responsible for all the VFX. I decided that I didn’t want to use translucent materials for my effects, except for that I wanted fairly realistic animations and colors to match the style of our game. That way it was easier for me to figure out how things should look, and not using translucent material gave me a big challenge that I learned a lot from.

After that, it’s just figuring out how I wanted things to look, and struggling with how to make a fire shader. Just as I had a lot of problems figuring out the realistic shader I had the same with the stylized, with the lack of tutorials (even though it’s better now then when I started) it was a lot of trial and error.

The smoke was way easier to figure out, I read a talk from Fortnite where they talked how they made their smoke puffs. That gave me a fairly good idea of how I should go about, so the smoke I did is very simple. It’s just a few combined spheres that I mask away with a noise texture and using Fresnel over lifetime to mask it away.

Conclusion

I think, my biggest suggestion to aspiring VFX artists is to not give up at the start even if things are slow. It took me quite a long time to get started properly with the basics then things speed up a lot.

Find a tutorial that creates something that you think looks cool and do that. Don’t start with the standard fire/smoke, create a more complex shader or effect. What got me finally started was a Chinese Sword slash tutorial, it was a pain to Google Translate the page but I ended up with a pretty cool looking sword slash. And most importantly I was able to modify the shader and use that knowledge to a lot more effects, which is the important thing if starting with a more complex shader in my opinions.

Because then you can break it apart and use those parts for other effects. If you start small then you must add stuff and gather more knowledge instead of using what you already have. And from my experience, I learn best from just breaking apart effects, take bits and pieces and create something of your own. In that way, you’ll gain the full understanding of the effect instead and figure out how to use the knowledge in different ways.

I’d say some of the best tutorials are ImbueFX (very old but still really good), Andreas Glad for a bit more technical Houdini-related effects and Yoeri Luos Vleer for quite a lot of UE4 effects. Except for that, it’s mostly searching around on the internet to find a few gold coins here and there. You can also find quite a lot from the RealtimeVFX forum.

It was a lot of fun to do the breakdown, and hopefully, it will help some people to get a better understanding of how to create a campfire so they don’t have to struggle as much as I did.

1 of 2

Erik Forsström, VFX Artist

Interview conducted by Kirill Tokarev

Join discussion

Comments 1

  • vyacheslav

    excellent , this is cool asset

    0

    vyacheslav

    ·5 years ago·

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