109|blog.unity.com
Making fire feel alive: Real-time fluid simulation in Ignitement
In today’s guest post, solo dev Sørb breaks down the technical artistry behind the impressive fire and lava VFX in his upcoming action roguelite, Ignitement.The first thing you notice when looking at Ignitement is the VFX. There’s something immediately different about them, especially the fire. It doesn’t just look animated, it feels alive, reactive, and deeply integrated into the world.So what’s going on under the hood?Why you should care about fire VFXFire, and fluid-like effects in general, are notoriously difficult to get right in games. Traditional particle systems can look great, but they often lack true interaction with the world. On the other end of the spectrum, full 3D simulations are usually far too expensive for real-time gameplay.A few games have explored fluid simulation as a core mechanic. In Little Inferno by the Tomorrow Corporation (above), fire behavior is central to the experience, while Steve Mason’s Plasma Pong (below) builds its entire gameplay around reactive, flowing motion. These examples highlight how powerful fluid-based systems can be when they directly influence gameplay.The core ideaInstead of relying on particle systems, Ignitement uses a fully dynamic, real-time fluid simulation.At first glance, this might sound expensive.“But doesn’t that just set your PC on fire and tank performance?”At least not the hardware.The simulation is entirely 2D and runs through Graphics.Blit, updating a small set of textures (primarily 1024×1024 and 512×512). In practice, this makes it comparable in cost to a few post-processing effects.Another deliberate choice was to stick with fragment shaders instead of compute shaders. This lets the system take advantage of built-in texture filtering and interpolation, while also keeping compatibility high, even on older hardware or potential console targets.To make things easier to follow, we can break the system into three parts:SimulationRenderingLightingFluid simulation breakdownAt its core, the system is a standard fluid simulation implemented entirely via Graphics.Blit passes. The simulation operates on several textures, each representing a different physical property:Density (1024×1024, RGBA half) This is your smoke, everything that makes the air feel thick and visible.Velocity (512×512, RG half) This controls how things move. If something flows, drifts, or swirls, this is why.Temperature (1024×1024, single-channel half) Determines how hot different regions are.Reaction (1024×1024, RGBA half) This is where the actual fire lives, its intensity, spread, and behavior.Keeping this structure in mind, the fluid solver can be outlined with this pseudo-code:The reaction data even escapes the GPU from time to time. It’s downsampled and read back on the CPU to drive gameplay effects like damage. So yes, the fire doesn’t just look dangerous, it actually is!The simulation domain itself isn’t fixed in the world. Instead, it follows the camera and shifts as the player moves. This creates the illusion of an endless, continuous simulation, even though only a relatively small region is actually being computed at any given time. Smoke everywhere, cost nowhere.RenderingOnce all that data is in place, the next step is making it look like something you’d actually want to stare at.FireFire is rendered from the reaction texture, which is treated a bit like a heightmap. A parallax-style trick in the fragment shader gives it a pseudo-3D look, adding depth without the cost of true volumetrics.SmokeSmoke and fog come mostly from the temperature information. These are interpreted in the shader to produce soft, evolving shapes that feel surprisingly volumetric for something that’s technically just a couple of textures being pushed around.EmbersAnd of course, no fire is complete without embers.These are GPU-driven particles that sample the velocity field, meaning they naturally follow the flow of the simulation. No extra logic needed, they just go with the flow (literally).These ember particles are updated and advected using a custom GPU implementation (no Shuriken, no VFX Graph). So just a ComputeBuffer for all the particle data, a ComputeShader.Dispatch call to update them, and a Graphics.DrawProcedural call to render them to the screen.LightingCalculating the light mapLighting is handled using a simple trick that ends up doing a lot of heavy lifting.The reaction texture is downsampled and blurred, turning it into a dynamic light map. It’s not physically accurate, but it doesn’t need to be. It just needs to look right!Applying lighting to the environmentWhen rendering objects, lighting comes down to a single texture lookup in a custom shader.Instead of sampling directly at the surface, the lookup is nudged slightly along the surface normal:
worldPosition + worldNormal * cThis tiny offset goes a long way. It creates the impression that light is coming from the environment, giving surfaces a convincing sense of depth and directionality.All of that, from one texture sample. Not bad.If you want to know the details, here is the shader-function I use:I just put this function and all needed uniform variables in a .cginc file and conveniently use it in any shader that wants to read from the light map.Extending the light map beyond lightingOne of the nicest side effects of this setup is that the light map isn’t just for lighting.In Ignitement, parts of the UI actually use it as well. Elements with normal maps sample the light map to fake reflections. For example, the glass of the health container picks up the surrounding fire, making it feel connected to the world instead of just sitting on top of it.This also opens the door for more unusual effects.In one area, the environment is made up of “flesh walls” (because why not?). These use the light map to control how strongly they wiggle. The more intense the nearby fire, the more the walls react, giving the impression that the environment itself is alive and not particularly happy about being on fire.Even better, this is all done in the vertex shader, making it extremely cheap for something that looks this dynamic.How do fire VFX affect gameplay?Visuals are nice, but a good VFX system alone doesn’t make a good game. In Ignitement, fire directly affects gameplay: any enemy touching it receives a burning debuff that deals damage over time.To make this work, the simulation data has to be available on the CPU. Each frame, the reaction texture is downsampled and read back using AsyncGPUReadback.RequestIntoNativeArray. Instead of doing expensive per-object queries on the GPU, the system reads the texture once and performs cheap lookups on the CPU for every enemy. Using a simple threshold, this effectively behaves like a single, highly dynamic collider that perfectly matches the shape of the fire at any given moment.Limitations and trade-offsOf course, this approach isn’t perfect.Because the simulation is 2D, anything happening vertically is more of an approximation than a physically correct solution. Also, shifting the simulation domain requires a bit of care to avoid visible seams or popping.That said, these trade-offs are very intentional. They keep the system fast, scalable, and widely compatible, while still delivering results that feel rich and reactive.Key takeaways2D fluid simulations can go a lot further than you might expectReusing simulation data is where a lot of the magic happens“Looks right” often beats “is physically correct”GPU-to-CPU readback is perfectly viable when kept smallOne well-designed system can drive visuals, gameplay, and UI all at onceBy building everything on top of a shared fluid simulation, Ignitement ends up with a cohesive visual style where fire, lighting, UI, and even parts of the environment all speak the same language.The result isn’t just better visuals, it’s a world that feels more connected, more reactive, and more alive.And all of that starts with a few textures, a couple of shaders… and setting everything on fire.If you like fluid simulation and survivor-likes / roguelikes feel free to wishlist Ignitement on Steam and join the Discord. Explore more Made with Unity games on our Steam Curator page, and check out more stories from Unity developers on the Unity Blog and Resource Hub.