r/GraphicsProgramming • u/Medical-Bake-9777 • Jul 25 '25
Question SPH C sim
My particles feel like they’re ignoring gravity, I copied the code from SebLague’s GitHub
Either my particles will take forever to form a semi uniform liquid, or it would make multiple clumps, fly to a corner and stay there, or it will legit just freeze at times, all while I still have gravity on.
Someone who’s been in the same situation please tell me what’s happening thank you.
2
u/Perkovic15 Jul 25 '25
You messed up forces on X axis somewhere
1
1
u/Medical-Bake-9777 Jul 25 '25
Not sure it’s the X axis, checked it and the pressure force which interacts with x pos is being added properly, I couldn’t actually copy the code directly because of some reasons so I had to sort of do it in my own way, I made it so acceleration is a compound of previous frames instead of single frame replace the current acceleration but now my particles are pancaking
2
u/Perkovic15 Jul 27 '25
I made my own implementation in HLSL, if you wanna check it, dm me your email, i can give you github access.
1
7
u/sakata_desu Jul 26 '25
Btw if you hit the windows+ G button the windows game bar pops up and you can record what's on your screen instead of posting an awkward phone recording with your reflection distracting everyone
41
Jul 25 '25
[removed] — view removed comment
-7
u/Medical-Bake-9777 Jul 25 '25
uhm ok so ive already been working on this for awhile and tried coding using flip but realized i needed better efficiency, i copied his code because im at a point where even after i researched since last december nothing came back, im not really the brightest in these things and i just wanted some help. Im a first year engineering student just trying to make something work so cut me some slack.
9
u/necoarcc__ Jul 25 '25
screen recording left the chat