Тёмный

Coding a Realtime Fluid Simulation in Unity 

AJTech
Подписаться 8 тыс.
Просмотров 35 тыс.
50% 1

Got really curious about Realtime Fluid Simulations and I put together this video that will hopefully help you understand how it all works, the core technology used is Smoothed Particle Hydrodynamics, and everything is written from scratch in Unity using C# and Compute Shaders.
If this video gains some interest I'll release a second part about optimization and making the fluid look cooler, just leave a comment down below if you're interested.
Also tried a new editing style, and would love some feedback. It's been a while since I released a video so thanks to everyone who's supported me so far :)
I'll see you all next time ✌
---
Project Links
---
GitHub: github.com/AJTech2002/SPH-Uni...
Base Project: github.com/AJTech2002/SPH-Uni...
FluidRayMarching.cs : github.com/AJTech2002/SPH-Uni...
---
Information Links
---
SPH Paper: matthias-research.github.io/p...
Sebastian Lague Raymarching: • Coding Adventure: Ray ...
Thread Groups Medium Article: / compute-shader-indices
---
Timestamps
---
Intro: (0:00)
SPH Explanation: (0:45)
Project Setup: (4:22)
Initializing Particles: (5:03)
Compute Shader Setup: (9:24)
Integrate Function: (10:33)
Linking Compute Shader: (12:09)
Density & Pressure Calculation: (14:13)
Force Calculations: (16:45)
Testing: (20:25)
External Forces: (21:07)
Raymarching Setup: (21:48)
Outro: (22:43)

Развлечения

Опубликовано:

 

25 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 37   
@icantdrawhandss
@icantdrawhandss Год назад
its nice to have you back!
@konka1906
@konka1906 Год назад
really great video quality
@_yuri_n
@_yuri_n Год назад
Thanks , I really learned a lot from your video,Looking forward to your next video
@batchprogrammer108
@batchprogrammer108 Год назад
Thanks, currently editing the optimization video :)
@evgeniipetrov2808
@evgeniipetrov2808 Год назад
epic comeback!
@venkatgopal2454
@venkatgopal2454 Год назад
Very good video 👍
@monotone5402
@monotone5402 11 месяцев назад
very nice
@alejandrosainzmartinez9548
@alejandrosainzmartinez9548 10 месяцев назад
Hi! I have an URP project and i don't know how can i adapt the shaders in the project to work properly. I tried to upgrade the shaders but apparently this can't be done in custom shaders. Can someone tell me where can i learn to do this? Or if someone can provide an URP version of the shaders it would be very helpful.
@pawartrader
@pawartrader Год назад
The King is Back.
@batchprogrammer108
@batchprogrammer108 Год назад
much love bro
@batchprogrammer108
@batchprogrammer108 Год назад
Part 2 on Optimization (60,000 particles) : ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-9M72KrGhYuE.html Hey everyone, hope you enjoyed the video! I'd love to help with any questions or issues you have with the video so just leave a comment if you need something :) If you are wondering about how to optimize this code I have a branch on the GitHub with the optimization implemented github.com/AJTech2002/Smoothed-Particle-Hydrodynamics/tree/feat/optimization
@VFORVICTORY1000
@VFORVICTORY1000 Год назад
thx for sharing
@bike_n_fish
@bike_n_fish Год назад
This video was just perfect, keep it on !
@swalscha
@swalscha Год назад
Love the content, thanks for sharing your knowledge! Does the kernel also take surface tension into account ? From the poly6 representation I suppose it does but by the visualization only it doesn't seem to be the case 🧐
@batchprogrammer108
@batchprogrammer108 Год назад
I actually didn't implement surface tension in this video because it's a little more difficult but I do plan to make a continuation tutorial for that 😁
@swalscha
@swalscha Год назад
@@batchprogrammer108 nice! I'd love to watch that 👌😁
@bike_n_fish
@bike_n_fish Год назад
Hey, thanks for this tutorial that was insane ! 11:36 nazi pro tip : if particleMass is constant, then 1f / particleMass is a constant too force * (1f / particleMass) will be faster to compute :P
@batchprogrammer108
@batchprogrammer108 Год назад
True! I'll keep it in mind next time 🤙
@квадратя
@квадратя Год назад
OMG, extremely useful video. Please make a new one about optimization
@batchprogrammer108
@batchprogrammer108 Год назад
Will do!
@квадратя
@квадратя Год назад
@@batchprogrammer108 I m really interested about building bvh trees for optimization using gpu.
@shawnhoareau7137
@shawnhoareau7137 4 месяца назад
Is the fluid ray marching script responsible for making the particles look like water?
@user-px5pj7ux5k
@user-px5pj7ux5k Год назад
how did distance times mass become density?
@selimgonen
@selimgonen Год назад
Very nice. Please create an optimization and shader video as well!
@batchprogrammer108
@batchprogrammer108 Год назад
I've added optimization into the GitHub on this branch (github.com/AJTech2002/Smoothed-Particle-Hydrodynamics/tree/feat/optimization) incase you're interested, currently working on the video :)
@selimgonen
@selimgonen Год назад
@@batchprogrammer108 glad to hear :)
@batchprogrammer108
@batchprogrammer108 Год назад
As promised - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-9M72KrGhYuE.html
@selimgonen
@selimgonen Год назад
@@batchprogrammer108 cool, added to my watchlist :)
@Smash_ter
@Smash_ter 26 дней назад
Like the vid, but what theme are you using in your vscode?
@shawnhoareau7137
@shawnhoareau7137 4 месяца назад
Hi does this work with URP?
@benjamindameworth5351
@benjamindameworth5351 5 месяцев назад
I downloaded the base project and it doesn't work in the sample scene
@tahaqazi376
@tahaqazi376 4 месяца назад
How we can enable this fluid to flow? actually i am working on a project "Fluid dynamics Experiment demonstration" where I am trying to create a environment where we can simulate fluid dynamics experiments like demonstration pf "water turbulence" or "Calculation of fluid flow". for that I need a realistic fluid simulation something similar to this video. Is there someone who can help me with this and guide me?
@monishdhayalan2552
@monishdhayalan2552 Год назад
cant open you channel man, it says channel page is missing
@icantdrawhandss
@icantdrawhandss 11 месяцев назад
…but then how did you comment 🫣
@monishdhayalan2552
@monishdhayalan2552 11 месяцев назад
@@icantdrawhandss just got this video on my recommendtions, I wanted to see the other videos but still cant able to see them
@icantdrawhandss
@icantdrawhandss 11 месяцев назад
@@monishdhayalan2552 ohhhh yeah right
@nimagames8639
@nimagames8639 Год назад
Hey Can you tell me how to make a fps shooter controller?? I really want to make an fps controller with everything. Thanks.
Далее
Coding Adventure: Simulating Fluids
47:52
Просмотров 1,7 млн
Ocean waves simulation with Fast Fourier transform
14:26
Finally, A Blazing Fast Fluid Simulator! 🌊
7:49
Просмотров 832 тыс.
Bad Apple but it's a Fluid Simulation
3:59
Просмотров 501 тыс.
Coding a Fluid Simulation with my Last 2 Brain Cells
4:24
Giving Personality to Procedural Animations using Math
15:30
Beautiful Fluid Simulations...In Just 40 Seconds! 🤯
5:04
Simple Liquid Simulation in Unity!
15:46
Просмотров 131 тыс.
Spot The Fake Animal For $10,000
0:40
Просмотров 149 млн