Bruno Afonseca: Sketch #48

Finished entry, in Unreal Engine: (reupload because I messed up exposure on the previous)

Thumbnail:
Campfire_Looped_Gif

Original post and reference:

-x-

Hi folks! Thinking about giving this one a shot, though I’m a bit late… let’s see if I can make it.
I put together some reference, showing campfires at different times of day with different shutter speeds, since I want to have that in mind as I build the effect:



(right click and open in new tab if you wanna see it real big)
10 Likes


Playing with the latest version of EmberGen, looked through the presets to take some notes, and started a simulation from scratch to try to roughly match the scale and look from the reference. I’m using an ellipsoid emitter, 60x60x15cm, a bit closer to the real world scale of the reference. Had to resize the simulation a bit to fit, and tweak the emission parameters a lot. The tickbox “Flames translucency” under Shading/Flames was crucial to get this aspect on it. It feels like there are multiple possible approaches, but this is enough for now!

6 Likes


I’m running multiple tests here, trying to figure out what’s the lowest resolution a frame can have without looking bad close up, and how much shredding I can have without making the looping too apparent. Moving very fast here because I’m running out of time!

5 Likes

flame400
Got my flipbook! Now I’ll start making up a lil scene for it.

9 Likes

really nice motion in this - looking good!

1 Like

I dig the sweet motion! Also i’m wondering if getting smooth loops is a thing now in EmberGen? - Good stuff.

1 Like

I did get it to loop well on EmberGen, I just had to mess with the loop range a bit to find one where the transition wasn’t noticeable!

I’m done! First post updated with the final video. I’ll possibly share some notes about the effect here…

2 Likes

A few notes I thought would be interesting to share:

1 - There are no particles, everything here are meshes with vertex shaders. See more examples of this technique: https://www.artstation.com/artwork/KrX3lx

2 - The motion blur of the fire is built into the texture. I’ve rendered out 288 frames from EmberGen, then applied motion blur on them (You can also use RSMB plugin on After Effects or Davinci Resolve’s Motion Effects, both paid). Then I accumulated 4 frames on top of each other and averaged them out, ending up with 72 frames. I did this to have the most amount of overlap between frames so I could pack a long animation on a small flipbook. Just 72 frames with no motion blur has a strong strobe effect that didn’t work well for my scene. Here’s a comparison of an original vs. processed frame:


You can definitely see some ghosting, but I think it works in motion. Pretty sure I can fix this if I spend more time on it.

3 - The 72 frames are packed on a 6x4 2048x2048 flipbook, so each ‘frame’ actually contains 4, one in each channel. So I lerp between the RGBA channels before stepping the UVs over to the next set of frames, if that makes any sense. This only works acceptably using the BC7 compression, anything else (like DXT5) ends up looking too rough close up. Of course this only works when your textures are grayscale. Here’s how the texture looks like (RGB only, no A):


To build this, I rendered 4 flipbooks using Slate, each flipbook with a 1 frame offset from the previous, then I smooshed them together on the RGBA channels on Substance.

4 - The flame mesh is a bent plane. This made intersections with the firewood meshes a bit more interesting. And instead of doing a straight up depth fade, I’m using the result of a depth fade node to alpha erode my fire. So instead of a very soft fade at the geometry intersections, we get some of the nice fiery shapes (look at the topmost piece of wood, how the flame seems to wrap around it).

4 - Meshes are Megascans assets. I made custom materials for all of them, and included a material function that creates the center glow based on a XYZ position and a falloff distance, that I keep in a material parameter collection so I can make small adjustments.

5 - Lighting this is a bit of a pain, if the geometry is set to cast shadows, it looks rather awful since the light is coming off a single point instead of a whole volume, you get pitch black sharp shadows covering the ground. So I disabled shadows on everything, and manually placed blob shadows on contact points. Otherwise the firewood seems to be floating above the ground:
Campfire_Shadows
Casting shadows, looks awful
Campfire_FakeShadows
Comparison GIF showing the contribution of the fake blob shadows

7 - Smoke flipbook by Thomas Iché at Unity: https://blog.unity.com/technology/free-vfx-image-sequences-flipbooks
Planned on replacing that with one of my own, but ran out of time! Since the smoke is very faint here, I think I got away without needing to render smoke from this specific flame. Some kinds of wood can be smokier, but I wanted very little smoke in this one.

8 - Overall I’m satisfied with the results, though there’s a lot of room for improvement. In the future I’d like to spend more time trying to replicate the dancing light and shadows you see in the reference, and getting more complex motion on the sparks (more turbulence, more bendiness, more bursts). Perhaps adding secondary flame licks too, and better interaction with the firewood, nicer embers. I built some wind functionality into this (the flame bends, like Klemen shows here https://twitter.com/i/events/1065646095093526528), but I didn’t have the time to actually animate it and make it look good, so next time!

30 Likes

fantastic work Bruno !

1 Like

Easily the cleanest fireloop I have seen so far, amazing work!

What channel did you render out from EmberGen for this?

1 Like

Amazing work! Looks just stunning!
If you don’t mind me asking, how did you go about setting up the material to lerp over each pack of RGBA frames before stepping over to the next set of frames?

1 Like

Thanks! I rendered out temperature but remapped to a grayscale gradient, I played a lot with the positioning of the keys so I’d trim the soft smokey aspect you get at the low range. The ‘fire with modulation’ template can give you some ideas, though I didn’t use modulation in the end.

1 Like

Here you go:

The A channel is basically the R offset by 1, if you can afford a second sampler, you could just use the RGB channels instead.

5 Likes

Wonderful, thank you for sharing!

1 Like

Awesome work Bruno! Nice breakdown.

1 Like

Great stuff Bruno! hats off!

1 Like

Very impressive work, and thank you so much for sharing the breakdown, it’s very helpful !!

1 Like

Thanks for sharing a breakdown of this sweet fire!

1 Like

Turned out so cool, great breakdown!! :blush: :fire:

1 Like