 Ok, hola. Well, first of all, I just wanted to say thanks for this conference. It's my first time and have been really cool to be here and to share this experience. I don't know if you were in the talk from illustration to animation by Nacho Arjona. He made this joke about Nachos and I made the same joke in my presentation because I'm also called Nacho, actually Ignacio but in Spain is the same name. So yeah, I studied theoretical physics but I never had the chance to actually go into that field because I discovered Blender and that kind of moved me away from that. Well, I have a YouTube channel, kind of, well that's my cat, not my YouTube channel. Well, I also have a cat that is very cute and that's my YouTube channel where I upload some of my stuff. I like to work with procedural stuff. So yeah, I make some nice stuff with geometry notes. It's like a press that I made procedurally. It's a very short video, I'm sorry. And also I make some more disgusting stuff that I like. It's like Seder procedurally. Ok, so today I'm here to talk to you about sea dynamics without fluid simulations. It's not the most interesting topic but yeah, maybe you enjoy it. My Spanish accent might help through it. Ok, why did I get into this? When I was studying my bachelor in physics, I was kind of unmotivated in the last year. So was COVID, lockdown and stuff. And I was seeing all the possible topics that I could choose. And all of them were really, really tough. Like, I don't know, like quantum field theory, bosons, stuff like that. And I was not in the mood to get into dedicating six months of my life of that. And then I found one of the possible thesis that was animating a ship moving in the ocean. And I was like, well that seems a little bit easier, at least I understand what is saying. So yeah, that's how I get into that. And then I have some conversations with my thesis supervisor, all my teachers and stuff. They show me how we were going to face the problem. And yeah, how it was going to be. And then they show me the software that we were going to use to animate. And it would look something like this. So yeah, I was not in like 3D un stuff by them, but I knew that this was looking really bad and I didn't want to have something like this. So I did a little bit of research on which software I could use to improve this. I went to Maya, Cinema 4D, also Houdini. And then I found Blender. And it was free, all this community with all these tutorials that I know that they were going to help. And yeah, also with animation notes by then that could make all these solvers for physics. So yeah, I proposed them to do it in Blender instead and they let me do it. Yeah, now why without fluid simulations? Why did I decided to go through the process without a proper fluid simulation? Well, it's not that I have anything against fluid sims. I think that they are really cool if you know how to do them. They are a little bit time consuming, but anyway. But I feel that if you can find a way to get a similar result in a different way, yeah, maybe it's worth it to give it a try. I don't know if you have seen this procedural river that they have done with geometry notes. Yeah, so I think that if you can get that through geometry notes instead of through like a proper fluid sim with the river that might be a mess to do, well, that's more, that might be better. So now I wanted just to go briefly through what is a fluid sim, what is like the physics behind it. So, yeah, it's kind of like, we can understand what is behind it and why it's so intense. So we have, well, this is mid-journey. I put just some pictures of mid-journey if you feel that they are kind of weird. So we have a fluid and we want to know how it's going to move. Physically we will apply the Navieres-Tox equation that is there. I don't know if you are familiar with these mathematical notations, but basically it's going to tell you how the pressure of the fluid is going to change in space and time. The pressure is this thing that when you dive, it hurts your ears. So yeah, it's going to tell you how it changes. Then when you have that, you have everything that you need. Then you can calculate the force that this fluid would act or exert, I don't know if the word is exert, on any type of object, like a boat. So problems of this way of facing the problem is that these equations are really difficult to solve in paper. So this means exactly. It's actually one of the seven million price problems. So these are like seven mathematical problems that if someone solved them, they would get like a million euros so like I think fame and glory for all your life. Exactly you need to prove either that a smooth globally defined solution exists that meets certain conditions or that they do not always exist and the equations break down. I don't know if I don't really know what is the meaning of this phrase, but you can see that this kind of like a really hard problem. Also for practical, if you are a 3D artist and you want to go through fluid themes, going through the exact solutions is not the best way. So what we do is we discerticize the space. We don't think about the space as an infinite number of points. We just think about like a grid that when you make a fluid theme there is always like a grid that appears there. So yeah, once that you do that you can actually compute this stuff and you can have like a fluid theme working. Then if you want to also calculate how much this fluid is acting on an object so the pressure how is affecting it you can't also think about the object as a real object. Like this means like made by infinite numbers of atoms. Well not infinite but a lot of atoms. So you need to simplify the object. In 3D we always do that right because you need to create an object made of faces. So a face is a simplification of how the reality is. Once that you have this you can really make the computations more efficient. Yeah, and here is like a little preview of what you will have. It's like all these forces on its face of the object by the way this is always perpendicular to the normal. And yeah, then when you have all the forces you can add them and you know how is the global effect on the object. Well, as far as I know Blender doesn't let you do a fluid effect in a rigid body. So if you drop something on a fluid you can make it like a collision so it will like make splashes and stuff on the fluid but the rigid body will go through it without changing anything. But Houdini lets you do it so I imported Susan there and I made a little try and you can see that definitely gets some reaction and it looks good. But yeah, then it wants to come back home. So, okay. Proxen cons of this method well the process obviously having a high resolution fluid working physically based can be super cool. But then, well then also you have the interaction and stuff but yeah, then can be really expensive. I have here like an example from Vinny that is over there of like one of these fluid seams. It's done in Blender so it doesn't have the rigid body stuff. But I think that it took like 12 hours to render to cast 12 hours to render and he send me the file it was like version 5 so he went through this at least 5 times, right? This is like version 37. So, I assume it was not very straight forward process but looks really good if you wanna follow this path. Okay, so now another way of having like a boat reacting to water is cheating it. Here I have like a video of how you can do it. You can just take a point on the ocean then you copy the position of your object there so you will follow it and then you can add some noise and some, yeah, like some noise in the location, in the rotation. So at the end it will look like it's floating. Well, here is me just having a little bit of OCD with how I organize the notes. But yeah, at the end it looks that it's floating. So it kind of works, very easy. There is a nice tutorial about this by Pixel3D. He does it in a different way now with geometry notes. But yeah, you can check it out. So pros and cons of this method, pros is quick and easy. And cons is not physically based. Might need tweaking because yeah, you put some noise so might do something that looks like it can look weird. And there is no interaction between the object and the fluid so there is no splashes and stuff like that. But you can always add some dynamic paint compositing or maybe some meta balls going around it and can look better. Ok, so now my approach was not using this cheating method but just simplifying the fluid simulation. What I mean with this is like, well, there was this guy, I don't know if you recognize him, he is Archimides and he made this principle that is like the upward buoyant force that is exerted on a body immersed in a fluid whether fully or partially is equal to the weight of all the fluid that the body displays. So this means that we can substitute all these forces acting on the surface of the boat and also the fluid seems by just one operation is calculating the volume of the object under the water just calculating the weight of the water that would be there and that's the force that is upwards. So yeah, that's definitely efficient. And pros of this method is physically based, it's quick, it's adaptable, can work in every situation but again there is no interaction of the fluid, there is no splashes and particles. But yeah, as I said can be always fake. Ok, so at this point of my thesis I was feeling really good, I was like, well, I find a way to do it, it's going to work really good and then I was also kind of thinking that I was the only one that thought about this, a little bit nice and then I saw this in GTA V and yeah, definitely this was a simulation, it's physically based and it's working in real time because it's a video game. So yeah, I kind of decided to research how the people in game development would go through that problem and I found this article called Water interaction model for boats in video games that basically explain you how to create a solver for real time in boats in video games. I learned a lot from it and then it kind of changed the perspective of this problem from kind of just doing whatever I could to making a real time solver in blender kind of video game style. Ok, so now I just wanted to introduce you of how the physics behind the method and how to implement them in blender in particular with geometry notes, not everything but almost everything. Ok, so yeah, so if you were bored before, now you are going to be much bored because it's just like rigid body physics. So sorry about that. Ok, so movement of a rigid body. A rigid body is kind of easy, it's not like a soft body because the distance between the points of the object are always constant in a soft body they change, so you need much more variables. You will have translation and rotation. So you can have an object translating then rotating and then the combination of both. You know about this, this is like animation. But for simulation this is nice because we can separate the two problems and treat them as separate pieces. So yeah, let's do that for the translation. An object moves because there are forces acting on them. If there are no forces, things don't move. If you have like a pen, you drop it, it falls because there is the gravity, right? If I push the computer it will move because I'm pushing it. So the force is a vector and if you have the vector you have the movement. Here I have an example, the force is the arrow and yeah, just because of that the object will move and you can solve the equations and it's like a straightforward process. There are three types of forces that can act on a boat. One is the weight of the boat, obviously. The other one is the friction with the water and the other one is the buoyant force, the archimedes one. The first two are straightforward. I'm not going to explain them and I'm just going to go with the archimedes one. So for the archimedes we need the volume under the water. For calculating that we just need to know which part of the object is under the water and these with geometry notes it's kind of easy to do, it's just a Reika's note. There is a part over there with the vector rotate that is just... because if the object is going to be rotating how it's called, the ray direction of the Reika's note needs to kind of balance to be always pointing in the global space upwards. So yeah, once you have that you need to calculate the actual volume of the object under the water. So how I thought that I could do this was just going face by face and calculating the volume of the water that is just on top of that face. So that means that it's kind of like extrusion and then you just have the distance over there from the face to the surface and then how much tilt there is on the face. So if the face would be perpendicular to the water there is no volume there. So you need to take that into account. So yeah, the volume would be the area of the face with the cosine of the tilt and then the distance. And this having can be done in geometry notes. You can see over there the Reika's note that will calculate the distance from the face to the water. That one is easy and the other one you just take... I don't know if you see from there. You just multiply the face area and then you just do like a dot product of the normal with the vertical direction and yeah, you just multiply both then attribute the statistic to add all of them so you have the total volume and you just store the attribute and then you have it there for forever, the volume. Yeah, here I have... Now once you have this you can solve the equations and here I have two examples with different parameters. This is without friction in the water. It's kind of weird, but how it would be if the water doesn't have friction and then a little bit more realistic with friction. It doesn't look still very good, but yeah, you see that it's reacting at least to the water. Ok now for the rotation. The rotation is a little bit more tricky because you need more things. You need the forces, but that's nice because we already have them and you need the point of application of the forces. So if I have here a pen, it's not the same if I apply a force here. It's not going to rotate. If I apply it here, it will rotate. So it's important to know where this force is applied. And that's what in physics we call a torque. You also then need to calculate the inertia of the object. This means it's not the same to rotate this pen like this than like this. This one is less... You need less force, less torque to rotate it. Here there is like a video dedicated teacher explaining it. So when he's with the arms extended, he's rotating slower and then he's with the arms like this, he's rotating slower because there is less inertia. Ok, so how we can calculate first the point of application because the force we already have it. For doing that we need to calculate the center of mass of the part of the boat that is sunken in the water. Well, Bender, if you just right click in the object, you can always set the origin to the center of mass or the surface. So you don't go under these calculations. But what is behind is just like that formula over there that is telling you just like go through all the faces of the object and do an operation. The operation is multiply the position of that face with the area and just add them all and then divide by the total area. And doing that you just have the center of like the point of application or the center of mass. Again this can be done in geometry notes the yellow part is just like you just take the face area and attribute the statistic and you add all of them and you have it. And then for the other part you have the over there the position again you have to rotate it to have like some consistency with the global space you just scale that position with the face area attribute the statistic to add them all and that's all. Then you have the position of the center of mass of the sunken part. Cool. Then for the inertia it's kind of like the same calculation it's the same process but instead of doing the operation of just the position of each area you have to do that it's the same but with different numbers I'm going to put it in geometry notes because it would be kind of like the same. If you have any questions you can ask me and I will show you. Here I have an example of just the rotation how will react to the water Again this depends on some parameters so maybe it's moving a little bit more faster but you can always tweak that. And here is the as I said before the composition of both Ok, so I explained how we how we get all the parameters I didn't explain how we actually get the change of position of the object and the rotation in time That's done with that thing over there that is a differential equation I don't know if you are familiar with that stuff but yeah I wanted to solve this in geometry notes It's not possible because you need to loop and you need to store some variables It would be really cool to have it there maybe in the future but yeah for now you need to write a script to do it It's not very complicated but yeah maybe one day everything is integrated and we can have solvers there Ok Now this last part my presentation is kind of last moment I kind of finish it this morning so it's still working process and it's about well my idea was well by the way I did all these 2 years ago in animation notes and now I did it again in geometry notes so I face this problem 2 times in different ways Anyway the idea was to have a real time solver video game style in blender for boats in water so I was thinking it would be cool with eeve we would have also real time rendering and then they come up with this real time compositor in blender 3.4 so that was also a big thing because then I could have the whole pack there in the viewport in real time so I maybe went a little bit or the line with this but yeah I just wanted to see this like BFX breakdown of black saves it's called the series I don't know if you have seen it I haven't but the BFX looks pretty good and yeah what is behind like a professional simulation of a ship in the water so we will have like a fluid sim I'm not going to have that on eeve because I'm using dark images principle not fluid sims and then you have obviously say there's some rain overlay backgrounds, volumetrics color corrections, less distortion etc so yeah maybe I could try to have something like this on eeve obviously it's not going to look like this but just kind of get inspired by it so yeah now I'm going to go to blender and show you first the simulator with some examples and then the real time eeve thingy now is when blender crashes and everything goes wrong but yeah ok I need to change some stuff with the projector so one second oh I can't see my screen now ok good so here is the simulator I made it like a little bit user friendly there also one thing of how I move on time ok one thing that I hate about proper solvers is that they have so many parameters I don't know you have been working with Houdini but in Houdini you can have like a stiffness, damping but like seven times in the same solver so it's like what is going on so I just made two parameters that are like the ability, that is just how heavy is the object if it is still kind of sunk and if it is one it will bounce away and then the buoyancy that is how much friction there is in the water so how much kind of relax the movement so ok so if I would click simulate well it's not working in real time I think no yeah it is ok so yeah if you can see it the cool thing about this is like I could also now so I could play with it so yeah it's kind of working nice I can also just to the ship to go away and it will fly ok so that's one I'm going to show you some more here is Susan makeship and yeah well now you see that it's sinking so I will need to change the floatability a little bit up so yeah also the buoyancy maybe another example here with this one I wanted to make the donut of the blender guru but I didn't have time well here you can see that maybe it's a little bit more of mass like the and also the buoyancy is too high so maybe going with this down will make it ok so yeah this is like the solver now let's go to the real time easy thingy that I made with blender 3.4 and yeah this is like real time in the viewport I made this a little like very quickly some compositing with some overlays the rain overlay that I used was very crappy so it looks really bad I blew it a lot but yeah here you can see maybe some people here know much more about compositing than me but yeah it's kind of cool that you can now well when blender 3.4 is around that you can just play around in the viewport just composite everything I have your own scene there yeah I still need to there is intersection between the boat and the water so that doesn't look very good but yeah this is how it's working in blender and now I'm going to finish the stand now you are not seeing the presentation maybe a problem well anyway yeah this is it thank you very much