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…
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:
Casting shadows, looks awful
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!
fantastic work Bruno !
Easily the cleanest fireloop I have seen so far, amazing work!
What channel did you render out from EmberGen for this?
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?
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.
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.
Wonderful, thank you for sharing!
Awesome work Bruno! Nice breakdown.
Great stuff Bruno! hats off!
Very impressive work, and thank you so much for sharing the breakdown, it’s very helpful !!
Thanks for sharing a breakdown of this sweet fire!
Turned out so cool, great breakdown!!
Very realistic fire, cool. If it’s not a secret, what do you do with Alpha after saving it in BC7 format, is it white for you? Are you still adding additional sets of frames?
Oh the alpha has the same content as the R channel, just offset by 1. The only reason I’m using the alpha channel is to simplify the shader a bit - you could throw a second texture sampler and do some lerping to make it work without having an alpha channel. On BC7, having an alpha channel or not does not change the texture size.
If you’re on DXT1, adding alpha channel doubles the texture size, making it into a DXT5. The compression artefacts are very visible on either of those though. Of course all of this applies to d3d only, If you’re working on other platforms it’s a whole another thing.
Hi Bruno. I realize it’s been quite some time… But when you added motion blur to your fire, did you think or try blurring it in SD without using the paid plugins you mentioned above? Or maybe during this time you have some way?
A simple directional blur won’t do the trick, it clashes with the motion in the flipbook and looks worse than without.
One thing you could do is getting motion vectors and then blurring along them, like TFlow does: 🔥 TFlow - Motion Vector Generator - #19 by matt-tuatara
Looks Amazing and so cool.
No 3 section you said “To build this, I rendered 4 flipbooks using Slate”…I want to know that which slate editor you used? FDFX Slate Editor or something else?
Thanks! FDFX is correct, yeah!