logoalt Hacker News

myzeklast Tuesday at 10:15 PM3 repliesview on HN

So once upon a time I stumbled upon simulating fluids in gamedev and I really wanted to learn how it works. Fast forward 2 months and I decided to write down everything I learned to hopefully make it easier for others in the future!


Replies

magicalhippolast Wednesday at 12:54 AM

Fluid sims are just so darn fun! Nice writeup, very accessible.

Couple of notes, I think you forgot to apply timestep when adding rocket exhaust velocity, pretty sure it should be

  u[idx] += backward.x * flame_velocity_amount * falloff * delta
  v[idx] += backward.y * flame_velocity_amount * falloff * delta
You need to compensate by scaling up flame_velocity_amount, I used 85, seemed about the same.
show 1 reply
brandonpelfreytoday at 3:49 PM

Great job. I have spent a lot of time working on fluid simulations (I still am). Glad to see more people still mesmerized. If you’re interested, this rabbit hole goes very deep.

nick__mtoday at 2:32 PM

excellent article, great vulgarisation and human written !

Thank you