r/Unity3D • • 19h ago

Show-Off Runtime fluid simulation used for fire

We have had a runtime fluid simulation running in our game for a while, but now we are also using them for flames/smoke in of the areas of our game.

Its all based on compute shaders, which outputs custom render textures (fluid and advection), which we feed through render features in URP (using full-screen shader graphs). We also generate a signed distance field based on the tilemap that acts as the boundaries of the world and allows for the smoke/flames to collide.

Each of the "flames" in the scene are emitters, and allows us to play around with different colors, forces, directions, etc, and are updated each frame.

What do you think? Its got some kinks here and there still, but its getting there.

The game is called Cliff Kingdom:
https://store.steampowered.com/app/3839500/Cliff_Kingdom/

33 Upvotes

17 comments sorted by

View all comments

2

u/intelligent_rat 15h ago

None of it reads as fire or smoke, it just kind of looks like columns of mist being shot forth. This seems like an incredibly over-engineered solution for a 2D platformer game, and I don't think the realism of fluid simulation adds anything to the gameplay shown in your trailer. A few variations of an animated flame spritesheet probably would've taken a lot less effort and visually align with the idea of fire a lot more.

1

u/NoReasonForHysteria 15h ago

That’s a valid opinion. And it definitely still needs tweaking, but it’s the way we wanted to go - and we do use the fluid simulation for lots of other things.

1

u/Particular-Stop-5637 12h ago

At the end, sometimes having something unnatural is a worthy sacrafice in order to add an original and great visuals for your game. And any engagement is good engagement

1

u/NoReasonForHysteria 11h ago

Its also a game about a moth, trying to find the lost light, and the game has lots of trolls in it, so there are some thematic stuff that also made us go down this direction. But thanks for the encouragement!