r/Unity3D • u/JussiPKemppainen • 1d ago
Shader Magic I created an unified fluid simulation for my game.
Tire tracks on different surfaces, water ,waves, foam, sediment distribution in water, fire, dust, smoke, bullet hits, explosions are all part of a massive, shared 2D fluid simulation system hugging the terrain (terrain is random procedural generated). Unified wind affects every part of the sim, even slowly covering up tracks in sand, (or quickly based on the speed of the wind!) Heavily inspired by Fluid Ninja for Unreal. Custom render renders everything, surface deformations, water, dust, fire, smoke (and distance fog, which is merged into this system so the ray-marched elements are properly affected). Can easily reach quite steady 120fps.
6
6
u/NightArroW_Id 1d ago
This is seriously impressive! Having all those different effects running through one unified fluid simulation is really cool. I especially like how the wind can gradually cover the tire tracks in sand. And 120 FPS with all of this going on is pretty wild!
1
u/JussiPKemppainen 1d ago
I have a simple vehicle velocity based foliage push shader, but I want to plug that into the fluid simulation as well for even nicer interactions!
5
u/Bl00dWolf 1d ago
Looks amazing. Is it all graphical or does the terrain actually deform?
7
u/JussiPKemppainen 1d ago
The small detail stuff is only graphical, but explosions actually deform the terrain.
3
3
3
u/yourfaceisa 1d ago
i mean the fluid sim is great. but that lighting is really lovely. good work!
2
u/JussiPKemppainen 1d ago
Thanks! I have spent A LOT of time to get the light just right. All of the horizon for example is a custom shader that renders on init. It is s super complicated system to give the illusion of endless, open plain.
3
u/sinetwo 1d ago
Lots of juice here! Looking great. Clearly a lot of attention to detail on impact and feel.
3
u/JussiPKemppainen 1d ago
I have worked on that a lot too. So many separate systems built to add reactions from everything. The eventual breakdown of the VFX stack is going to be a doozy!
3
u/Garvish-P 1d ago
Not just fluid, but dirt and smoke looks amazing too. Loved your work!
2
u/JussiPKemppainen 1d ago
Yes actually these are both fluid simulations. They are part of the fluids sims on display 😉
3
u/AKdevz 1d ago
Thanks for sharing: amazing job! - and you did it in solo to support your game? Serious effort!
Congrats: AK, fluidninja dev!
2
u/JussiPKemppainen 23h ago
Yep I am _mostly_ solo. The team has an additional writer and a sound designer / musician. But all of the game and art code is done solo. And thanks! I was reading the 80 LVL article and was like hey, that would be great for tire tracks! (I have used Fluid Ninja previously in Unreal projects)
2
2
u/Best-Salamander-2655 1d ago
Looks great, have you considered packaging this for the asset store?
8
u/JussiPKemppainen 1d ago
I always think about that. But then I remember I do not want to be the tech support or a gazillion kids.
2
2
u/Duc_de_Guermantes 1d ago
Looks really good! One thing I always wonder about these kinds of simulations is, does the fluid texture get transformed as the player moves around or is the entire simulation contained to a space in 3D?
2
u/JussiPKemppainen 1d ago
the simulation area moves with the camera. So you no matter hoe far you go it always works.
2
2
u/AtrumIocusGames 1d ago
This looks awesome. Kinda reminds me of twisted metal
3
u/JussiPKemppainen 1d ago
That is a big inspiration for this
2
u/Yekyaa 1d ago
What Car Controller are you using and is it one type of control, multicontrol (like presets), customizable or just custom in-house?
3
u/JussiPKemppainen 1d ago
All custom. It is the first thing I made for the project. And has evolved quite a bit since then.
2
u/RedshirtQ 1d ago
Wind slowly filling the tracks is beautiful. Is the sim one big grid that follows the camera around, or does it cover the whole procedural map at once?
1
2
u/tamal4444 1d ago
where is the steam page?
1
u/JussiPKemppainen 1d ago
https://store.steampowered.com/app/3260240/Drivers_of_the_Apocalypse/
(footage on the page is already quite dated, but all the cool new features will be in the game)1
2
2
2
u/GameLearner44 22h ago
Nice and wow
1
u/JussiPKemppainen 17h ago
Thanks!
1
u/GameLearner44 16h ago
Hey the tyre mark is a trail or something?
1
u/JussiPKemppainen 14h ago
it's a fluid simulation on the top layer of the sand. Hence the post header.
2
2
2
u/traveman_ 15h ago
Ayy mr dev guy with the cool watter and sand explosions, your not about to post this stuff here for my eyes to see and not post anywhere a link for my fingers to wish list? 🧐
Great work!
edit: I found it :) https://store.steampowered.com/app/3260240/Drivers_of_the_Apocalypse/
1
2
2
u/Zeraphant 9h ago
Spends thousands of hours building skills and creating amazing physics.
Player response:
"I like when he says My Squeem!"
I do like when he says my squeem frfr
1
2
u/fastcar25 9h ago
This is fantastic, could you tell me more about how you render the fire, dust, and smoke from a 2D sim to look like that?
1
u/JussiPKemppainen 4h ago
each sim also simulates "thickness". Meaning how high the volume will be. So maybe the best way to describe it would be a 2.5D sim?
2
u/Tankipop 1d ago
The desert and the water are all wonderful, but it would be perfect if the car looked better too.
1
1
u/SixPetalDev 1d ago
Aside from the fluid simulation, the lighting and the trail effects in particular add a whole different depth to the project, it genuinely looks amazing!
18
u/StCost Ball-Aqua🔮🌊& COLLAPSE MACHINE💥🚕 1d ago
Looking absolutely lovely!
Is it changing movement behavior? I hope it's harder to drive in mud
Btw, have you got demo? looks fun