if you want the water surface to not be entirely still at rest - get some perlin noise - sample using combination of time and world space coordinates - feed into the thickness modifier
💬 Liquids! Fluids! Gas! Making perfectly accurate liquids is extremely difficult but this simplified method should work in most cases. I really like how this looks and you can go as crazy as you want with interesting shader effects! Videos Referenced: Make Awesome Effects with Shader Graph in Unity! ua-cam.com/video/VsUK9K6UbY4/v-deo.html Awesome Building Construction Shader Effect! ua-cam.com/video/OzyLWXTr3Io/v-deo.html Simple Wind Shader Effect in Unity ua-cam.com/video/VcUiksxYT88/v-deo.html Sprite Outline - Shader Graph Tutorial ua-cam.com/video/FvQFhkS90nI/v-deo.html
Worms WMT does it basically the same way. I already tested it with Dots, which has the benefits to have much more water "particles". I also change the mass of the objects which are depends on the world space height. It helps a bit to get a better flat surface on top
You can swap this to only using colliders and rigidbodys on the border or surface of the liquid shape and attach bones to it in sprite editor. It would be a lot less resource heavy.
Every other tutorial channel: Let's make a game. CodeMOnkey: Ok, guys let's make a fluid. Awesome work sir...keep it and thank you for the awesome tutorial.
@@Tarodev of course man. You've come quite far in the timespan of just a year. I've learned a lot from you. I'm using DoTween in almost every project thanks to you. I've also developed a game that makes use of your trajectory projection technique. (You were right about that not being my mother's trajectory line 😂.) One thing I've yet to figure out is where should I prefer async await over coroutines 🤔. All in all your tutorials have helped me a lot. I'll forever be grateful to you for that. Thank you ☺️
@@yahyabhatti7398 that's amazing brother. I'm so glad I could help you on your journey 🙏 I plan on doing a more in depth async video in the future. That might clear it up a bit 😊
I still think that if you have to simulate thousands of particles, celular automata is the way. Uses less resources; Unity GameObjects take a lot of resources, even more if you add colliders to lots of them. This can easilly get out of hands.
Awesome! You could make a whole puzzle game out of that fluid demo at the end. Something like the player has to get x amount of the fluid / gas from point a to b.
Looks like it, but its not the same: This uses GameObjectes with colliders for any fluids. Noita uses celular automata for simulating all the particles, as it has to handle thousands of "pixels" at a time.
wow now somebody can finally make the game all those facebook game ads deceptively pretend to be. ya know, the ones with the lava, pile of gold, soldier, and monsters in different compartments. i want to play that game!
Hey CodeMonkey, this is a really cool proof of concept! Have you seen games like Sanspiel and Noita? They use a different strategy to achieve some pretty dazzling results. I, for one, would love to see a tutorial on how to achieve something similar in Unity. Any chance you might delve into that in the future?
Yup Noita is very impressive, I've seen the tech behind it on a GDC talk they made, they use cellular automata for the simulations. Whenever I get back into Unity DOTS I'll certainly be experimenting with making a system like that, it should be 100x more performant than the simple system in this video.
Been waiting for this from you! Thank you! Out of curiosity, why didn’t you merge the circles’s mesh when the rigid bodies touch via code? I’m a beginner, so have mercy!
Making some code to look at all the circles and dynamically generate a mesh would be extremely complex and likely much worse performance. In this case working with pixels is much better.
@@CodeMonkeyUnity Huh. Interesting. In my personal project, I was attempting to draw a mesh from 3D physics bodies. To make an ocean surface for more realistic shoreline. Was hoping the DOTS would help, but I don’t want to blow up my PC 😂. Physics are difficult. Thanks for the response!
In that case you're discussing marching squares/cubes to build the appropriate mesh. You'd also want to consider looking into doing so on the GPU instead of the CPU. There's tutorials out there for it, but it's a step up in difficulty, and you certainly would have to be mindful of how much you attempt to do at once. In particular, if you're doing an ocean worth of water then you can probably ignore how water is affected if someone throws a rock in the ocean on the other side. In that case you want to look at ocean waves simulations and leave the water physics for places where the simulation is worth the cost of doing.
Thanks you for this video, I work for a school project in 3d and I use 20 spheres for the fluid and it's work very well. But can I use a 3D render texture for my project ?
I wish there was an updated version of this tutorial for 2020.3.32f1 a lot of things have changed, including shader graph stuff making it quite a bit harder to follow along for newbies such as myself.
@@CodeMonkeyUnity I just learned about the difference in urp and the standard with the unity engine. I was using standard. When I used urp all the same options were suddenly there. My newbieness got me. Lol
8:20 I don't get it, I've followed the instructions completely and when I go into game view the particles are not visible at all. I'm using a newer version of unity (2021.3.6f1), as the only real inspector difference I can think of is on the fluid camera: I dont have an Output option, I have a target option, and thats what I set the texture to
What do you suggest to use some advanced Liquid Asset from the store? Because performance wise, if you wanna do I don't know something like a Worms Game, when you destroy some Land then water start spreading....
Obi Fluid seems to be the best but I haven't tried it although this approach would work just fine in a Worms-like game, you usually have a handful of lakes, not oceans.
Or you could simply make collider of particles smaller/sprite bigger and add some texture effects at the beginning of vid. Anyway it looks amazing, but too complicated.
You could swap the circles for spheres but that would make it extremely performance intensive. For 3D you're really better off using a proper asset that is designed to be performant, there's a bunch of interesting free and paid ones on the asset store.
I've tried to makethis in 3d. To fill a pot of 35 cm diameter x 35 cm height, and with water spheresof 2 cm, it took about 2000 spheres. My notebook couldn't handle it (I7, 16 GB of RAM, integrated videocard ATI Radeon with1 GB). It worked at 2 or 3 fps. I will try something else.
Hmm. interesting. But without making the thing with the camera why not making the 2D collider a bit smaller. That way they can intersect. On the other hand without dublicating the object it would be much easier if we just use the particle system. That's another way to do it! :D btw I did not know the "not touch button". Thanks for showing me. :) also later i saw that he did the first thing i mentioned.
Hi Code Monkey! Awesome tutorial, but are you using a different version of Unity? I don't have half the settings you have in my camera for instance. I'm using 2020 1.5, Personal
@@CodeMonkeyUnity That was it! Thanks. I must've missed that step in the tutorial. Never used URP before until now, great stuff! Thanks again, and thanks for sharing your knowledge and expertise!
not sure if I follow but wouldn't this mean that the water is only visible on a square on the screen? since the quad doesn't take up the entire camera I mean...
Performance reasons. If you make the collider super small and include thousands of particles it will indeed look more realistic, but it will be extremely heavy.
🌐 Have you found the videos Helpful and Valuable?
❤️ Get my Courses unitycodemonkey.com/courses or Get my Steam Games 🎮 unitycodemonkey.com/gamebundle
The trick of using another camera is it similar to ray marching?!
How good it is if used for android? is it will be laggy?
@@muhiramadhan591 Depends on how many particles you use, what other things you have running in your game and your target device.
Only one thing I need to say: WHAT A TIME TO BE ALIVE
YES DR.
15 minute papers
I understood that reference
Carlo joneidfhehejsjdbfndjejsndn
WHAT A TIME TO BE ALIVE, BUT NO TUTORIAL FOR YOU.
Watching his videos is like going in a candy shop but you are just allowed to look
Wait, this is that mobile game ad where the guy keeps dropping lava on his gold.
Heh yup I've seen tons of those ads, stay tuned for an interesting video soon!
Found it
if you want the water surface to not be entirely still at rest
- get some perlin noise
- sample using combination of time and world space coordinates
- feed into the thickness modifier
💬 Liquids! Fluids! Gas!
Making perfectly accurate liquids is extremely difficult but this simplified method should work in most cases.
I really like how this looks and you can go as crazy as you want with interesting shader effects!
Videos Referenced:
Make Awesome Effects with Shader Graph in Unity!
ua-cam.com/video/VsUK9K6UbY4/v-deo.html
Awesome Building Construction Shader Effect!
ua-cam.com/video/OzyLWXTr3Io/v-deo.html
Simple Wind Shader Effect in Unity
ua-cam.com/video/VcUiksxYT88/v-deo.html
Sprite Outline - Shader Graph Tutorial
ua-cam.com/video/FvQFhkS90nI/v-deo.html
Why not pin this?
This is the best Unity Channel on UA-cam
Nice Tutorial Man,
at least we have someone to replace brackeys place
CodeMonkey is much better than brackeys :D
@@galrose7165 Eyyy Respect everyone! Have you thinked before you said that?! OMG why did you do that....?
@@nikeedev Comparing content is disrespecting? You must get your feelings hurt often.
i legit bought an Asset for this like a week ago, but this would work even better.... (thank you)
My pc is gonna cry after this
Worms WMT does it basically the same way. I already tested it with Dots, which has the benefits to have much more water "particles". I also change the mass of the objects which are depends on the world space height. It helps a bit to get a better flat surface on top
Thats an amazing idea
Where's My Water?
0:22 Be water my friend - Bruce lee
Lol i laughed.too much on ur dialog.😂
I was waiting for this the whole intro :P
I love the way you define liquid by saying Bruce Lee's words.
This is so awesome! I might use this technique in the future for an educational game in Chemistry
If Bruce Lee were to be a game developer
Paused just to find this comment
Was starting to think no one noticed
This is the comment I was looking for 😂 I was thinking no one noticed
You can swap this to only using colliders and rigidbodys on the border or surface of the liquid shape and attach bones to it in sprite editor. It would be a lot less resource heavy.
omg that Bruce Lee quote
I knew there was a LOT of magic behind ;) Congrats love it! Thanks for sharing
I liked when the sprite animator turned into a sprite renderer.
Every other tutorial channel: Let's make a game.
CodeMOnkey: Ok, guys let's make a fluid.
Awesome work sir...keep it and thank you for the awesome tutorial.
I am trying to add a lake to my game and I found this very useful
This codemonkey is rocking
That Bruce Lee reference was dope!
I was waiting for it. Super awesome 🔥. Thanks for this.👍
I would love a tutorial for optimizing this :)
Absolutely amazing. You're an inspiration Code Monkey. I've started making tutorials and would love to hear what you think!
Your tutorials are amazing
@@yahyabhatti7398 thanks buddy. I wrote this comment when I had just one video on the board. Humble beginnings 😊
@@Tarodev of course man. You've come quite far in the timespan of just a year. I've learned a lot from you. I'm using DoTween in almost every project thanks to you. I've also developed a game that makes use of your trajectory projection technique. (You were right about that not being my mother's trajectory line 😂.) One thing I've yet to figure out is where should I prefer async await over coroutines 🤔. All in all your tutorials have helped me a lot. I'll forever be grateful to you for that. Thank you ☺️
@@yahyabhatti7398 that's amazing brother. I'm so glad I could help you on your journey 🙏
I plan on doing a more in depth async video in the future. That might clear it up a bit 😊
@@Tarodev I'll be looking forward to it. Have an amazing day ahead 🌻
Pretty simple effect, loved the shader bit. Next step would be to make this with ECS and have billions of particles? ;)
Yup that would be awesome! I wonder how far we could push it
I still think that if you have to simulate thousands of particles, celular automata is the way.
Uses less resources; Unity GameObjects take a lot of resources, even more if you add colliders to lots of them. This can easilly get out of hands.
@@Xeros08 Indeed.
Awesome!
You could make a whole puzzle game out of that fluid demo at the end. Something like the player has to get x amount of the fluid / gas from point a to b.
All 3 «How To Bathe Your Cat» games have it. (UA-cam doesn't let me post a link, so search for them yourself.)
What a lovely Bruce Lee quote :D
this looks a lot like what noita does. just add some particle interactions with the environment and things get very dynamic and fun
Looks like it, but its not the same:
This uses GameObjectes with colliders for any fluids.
Noita uses celular automata for simulating all the particles, as it has to handle thousands of "pixels" at a time.
This was awesome man!! Thank you!!
Oh no, that's the ad that keeps haunting me!
Which one? The misleading mobile ads games? If so, stay tuned for an interesting video next week!
♥️♥️♥️ very nice explanation
THAT'S SO COOL 😱😱😱
I feel like you could also use ECS with the Jobs System in order to really maximize performance with millions of particles at once.
Yup, it would be fun to see how many particles we could add with DOTS!
@@CodeMonkeyUnity How can do this for 2d Platform ?
Love the Bruce Lee reference
it's cool technic for Simulation but i can't imagine using this in any serious game
Why not? There's tons of puzzle games that use liquids, same thing for Terraria and Noita.
@@CodeMonkeyUnity because it's very preformence heavy
@@itay7884 All that means is that you can't create a giant ocean but it's perfectly suitable for reasonably-sized bodies of liquid.
@@CodeMonkeyUnity i love how you tried to lie about noita using this kind of system lmaooooo
@@AlFredo-sx2yy What? Lie about what?
love your tutorial and bruce lee quote ;)
looks nice to implement with unity DOTS
Could you use the unity particle system to get more particles without the performance difference?
Hmm maybe but not sure, the limitation is mainly with the Physics engine not the Rendering engine.
No because particles need to collide woth each other as well
great use of the techniques!!! GG!
Great tutorial.
It motives me to create easy game.
Thanks and thumbs up.
wow now somebody can finally make the game all those facebook game ads deceptively pretend to be. ya know, the ones with the lava, pile of gold, soldier, and monsters in different compartments. i want to play that game!
Yup that's exactly the plan! I've always been annoyed seeing those fake game ads and now I can make them real!
@@CodeMonkeyUnity if you make this game I will buy it for real!
@@westingtyler1 guess what he did?
This guys voice makes me think of Kermit the frog. Good to know the muppets are still inovating after all this years. :)
Amazing! Thanks for this Tutorial
Wow it’s pretty
No way, I was just thinking about this like yesterday and it popped up in my recommendations
I'm glad you found the video!
an implementation of this in entity component system will solve performance problems.
This is soo helpful
Thanks for the like:)
0:25 Be water my friend.
Awesome thats great.
Im usign Unity 2021 and im trying to put de Texture on the Quad, but there doesnt seem to be a "Base Texture"
Hey CodeMonkey, this is a really cool proof of concept! Have you seen games like Sanspiel and Noita? They use a different strategy to achieve some pretty dazzling results. I, for one, would love to see a tutorial on how to achieve something similar in Unity. Any chance you might delve into that in the future?
Yup Noita is very impressive, I've seen the tech behind it on a GDC talk they made, they use cellular automata for the simulations.
Whenever I get back into Unity DOTS I'll certainly be experimenting with making a system like that, it should be 100x more performant than the simple system in this video.
GREAT Tutorial, thank you!! 👌👌
Been waiting for this from you! Thank you!
Out of curiosity, why didn’t you merge the circles’s mesh when the rigid bodies touch via code? I’m a beginner, so have mercy!
Making some code to look at all the circles and dynamically generate a mesh would be extremely complex and likely much worse performance. In this case working with pixels is much better.
@@CodeMonkeyUnity Huh. Interesting. In my personal project, I was attempting to draw a mesh from 3D physics bodies. To make an ocean surface for more realistic shoreline. Was hoping the DOTS would help, but I don’t want to blow up my PC 😂. Physics are difficult.
Thanks for the response!
In that case you're discussing marching squares/cubes to build the appropriate mesh. You'd also want to consider looking into doing so on the GPU instead of the CPU. There's tutorials out there for it, but it's a step up in difficulty, and you certainly would have to be mindful of how much you attempt to do at once.
In particular, if you're doing an ocean worth of water then you can probably ignore how water is affected if someone throws a rock in the ocean on the other side. In that case you want to look at ocean waves simulations and leave the water physics for places where the simulation is worth the cost of doing.
For really good results you can just skip the entire shader thing and just use the Legacy Shaders/Transparents/Cutout/Soft edge Unlit
😂 I saw your ad in your video what a coincidence 😅
Thanks you for this video, I work for a school project in 3d and I use 20 spheres for the fluid and it's work very well. But can I use a 3D render texture for my project ?
I wish there was an updated version of this tutorial for 2020.3.32f1 a lot of things have changed, including shader graph stuff making it quite a bit harder to follow along for newbies such as myself.
I covered Shader Graph changes here ua-cam.com/video/azGMuP9ks8U/v-deo.html
What else changed?
@@CodeMonkeyUnity I just learned about the difference in urp and the standard with the unity engine. I was using standard. When I used urp all the same options were suddenly there. My newbieness got me. Lol
Very good! But is there any way to do it without using more than one camera and Renderer Texture?
Absolutely brilliant! Thanks :)
Nice! Thank you!
Works great. How can we optimize the performance?
Can i mix the colors together? currently i can only display one color at a time
Finally my character can have water : D 😂😂
water has a few peaks, maybe you should decrease the force of friction and increase the force of gravity ...
THAAANKS 🙏
Would the performance increase by using unity's particle system?
Can you make Sph
Bruce Lee approves :)
Cool tutorial bro, Thanks for everything 😉🖤
Hmm its awesome but as soon as you start adding more fluid your cpu is gonna die beacuse it has to simulate so many rigidbodies.
8:20 I don't get it, I've followed the instructions completely and when I go into game view the particles are not visible at all. I'm using a newer version of unity (2021.3.6f1), as the only real inspector difference I can think of is on the fluid camera: I dont have an Output option, I have a target option, and thats what I set the texture to
Use Universal Render Pipeline
What do you suggest to use some advanced Liquid Asset from the store? Because performance wise, if you wanna do I don't know something like a Worms Game, when you destroy some Land then water start spreading....
Obi Fluid seems to be the best but I haven't tried it although this approach would work just fine in a Worms-like game, you usually have a handful of lakes, not oceans.
Could you simulate bouyancy with particles?
Bruce Lee word at 0:28
Or you could simply make collider of particles smaller/sprite bigger and add some texture effects at the beginning of vid. Anyway it looks amazing, but too complicated.
I guess, we also need to code surface tension of water.
Hey can you make a video on 3d fluid simulation please. Your videos are so good and informative and OfCourse helping.
You could swap the circles for spheres but that would make it extremely performance intensive.
For 3D you're really better off using a proper asset that is designed to be performant, there's a bunch of interesting free and paid ones on the asset store.
I've tried to makethis in 3d. To fill a pot of 35 cm diameter x 35 cm height, and with water spheresof 2 cm, it took about 2000 spheres. My notebook couldn't handle it (I7, 16 GB of RAM, integrated videocard ATI Radeon with1 GB). It worked at 2 or 3 fps. I will try something else.
Please make another full udemy course :D
I will but those take a ton of time to make so not sure when
Hey! We all love Bruce Lee
Nice!
code monkey bruce lee crossover event confirmed
Heard Bruce Lee's quotes.
Please how to break through the ground like "where's my water" game? I don't know how to do it.
Your Project Files link doesn't work
How so? You can't open the page? unitycodemonkey.com/video.php?v=_8v4DRhHu2g
What do I do if my background is a sprite renderer and so my quad is hidden by it? (using unity6 urp)
Bro thats so cleaver! Do you think theres a way to make a similar system to make it work with 3D?
This is very performance intensive so if you add a third dimension it will be tricky to get anything more than a puddle
Спасибо мужик \m/
Am I missing a package or asset that I need to install? I don't see half the options you do.
You need to install and set up the URP package (Universal Render Pipeline)
What options don't you see? Shader Graph? Install the Universal RP package
Hmm. interesting. But without making the thing with the camera why not making the 2D collider a bit smaller. That way they can intersect. On the other hand without dublicating the object it would be much easier if we just use the particle system. That's another way to do it! :D
btw I did not know the "not touch button". Thanks for showing me. :)
also later i saw that he did the first thing i mentioned.
The particle system could work but the main limitation is bound to be with the physics and not the rendering
@@CodeMonkeyUnity True true. Woudn't stop me from creating crazy stuff with this. ;)
Finnaly
I am facing a problem on your "Simple Inventory System" video, please reply me there.
Hi Code Monkey! Awesome tutorial, but are you using a different version of Unity? I don't have half the settings you have in my camera for instance. I'm using 2020 1.5, Personal
Are you using the Universal Render Pipeline?
@@CodeMonkeyUnity That was it! Thanks. I must've missed that step in the tutorial. Never used URP before until now, great stuff! Thanks again, and thanks for sharing your knowledge and expertise!
not sure if I follow but wouldn't this mean that the water is only visible on a square on the screen? since the quad doesn't take up the entire camera I mean...
cool
Hi. Is it possible to use this liquid system also for creating some sort of liquid based health bar? thanks in advance
probably
hi, very nice video! Can you make a similar video ( I mean liquid simulation) but for 3D games?
Instead of Circles just use Spheres, but the performance requirements will be so intense you wont be able to simulate more than a puddle
@@CodeMonkeyUnity true. What would you recommend for something more friendly performance?
@@GreenGnoblin its been over a year and no response yet lol
@@AlFredo-sx2yy haha yeah. I am not surprised.
Uhh question, since you showed 3 different colors in one of the scenes, does this mean you have to create cameras for each shader?
Yes :)
no you don't
Why not just set the collider to be smaller than the circle, that way the sprites will overlap and it'll look more like one body of water?
Performance reasons. If you make the collider super small and include thousands of particles it will indeed look more realistic, but it will be extremely heavy.