Thank you for the tutorials. This is exactly what unity should have implemented years ago in a default "buoyancy collider". The number of likes in this video is not proportional to the quality of the information given... you need millions! These two tutorials should be the first result if you search "unity boat on water"... it just took me 1 year to find this information.... Once again, thank you!
*_Love the tutorials and love you game! I would love a tutorial on how you setup the lighting and atmosphere in your game (fog, floating particles...)._*
If you have objects floating like I did, try changing the WaterHeightAtPosition to return ocean.position.y + displacementWaves.GetPixelBilinear(pos.x * waveFrequency* ocean.localScale.x, (pos.z * waveFrequency + Time.time * waveSpeed)*ocean.localScale.z).g * waveHeight; It is more correct to put the multiplication of localScale.x,z inside the GetPixelBilinear, to take into account if you rescaled the x,z dimensions of your water plane. Great tutorial though. Cheers, PetRem Labs
You are the MAN! That was the fix needed to properly scale with ocean plane scaling. Comes in handy when applying weather systems to smoothly change the scale of the waves. Thanks!!!
Thank you ! I don't have it anymore sadly... You should be able to copy it from the video though (from 2:28 of the first part of the tutorial, I show the node graph)
This is great but i'm having an issue. My cube just floats up way above the waves. I think the code is telling it the waves are much taller than the shader makes them appear. Code is 100% the same as yours and everything in Unity is set up the same. Maybe it has to do with the Normal Map? Guessing that because I know nothing about them and just grabbed some off the unity asset store.. Any ideas would be much appreciated! EDIT: I Got it!!! My issue was my ocean plane game object had different scales for x / y / z. Once i changed them all to 100, the boat floated on the waves correctly. Hope this helps someone.
This tutorial really helped me get my water physics working perfectly! I have a question though. I'm generating my wave displacement using multiple sine waves and some gradient noise. The biggest thing I could use from this tutorial is the Texture.GetPixelBilinear function, but as you'd guess. I'm not using a texture to generate anything. But I need to get the info from the the shader of the height of each vertex. How would you recommend approching this? I've been researching documentation for a couple weeks now but can't think of anything that would get me something similar!
Sgned up! Congratulations on your tutorials and your project! Will you take a tutorial on how to optimize a thick vegetation in HDRP? unfortunately there is really little stuff around...
Quick question, you use a normal map to make your water so you use an 2d texture lod node, in my shader, instead of using that I use a gradient noise node and it seems to do the same thing. so my issue is how do I reference that over how you're referencing the 2d te3xture?
Hello! if there's anyone experienced enough or knows how to get by this please help! I already have an ocean shader and all the variables are managed through the material on the ocean. I've tried implementing the ocean manager script and I simply can't get it to work. The video I followed was: How to implement Gerstner Waves with Shader Graph in Unity by Zicore. If anyone can help match the variables to the buoyancy script in this video, please respond.
So I think I did everythiright, but the things float way higher, it's like the point that they should be at is multiplied by something? can anyone help?
@@N0tTh3Pr0 The problem is: water height 0, acts like no waves, I put waterheight to 10, and the wave is at y 7 for example, the thing is trying to float at 14, if water is 14 it tried to float at 28, not with theese numbers, but you get the point
People that are having problems with scaling just use two planes set the main one to 1:1:1 and hide it, make the visible one as big as you want but make sure y scale is 1 and that will fix your problem
Shame this can't be done with regular unity. I tried to install that render pipeline and it balls up my project and pissed away 5 hours. Thank god i saved a copy before i started
Could you simuling a ship launching go down into slope 1° o 3° to sea o river. Ship length about 72m and airbags put down the ship (rotating + cinematic) moving?. Here include gravity force!
Actually I fixed it, but i don't know if it is the same problem for you. In the WaterHeightAtPosition method, I misswrote the formula, instead of putting position.z * waveFrequency + Time.time * waveSpeed, I put position.z * waveFrequency * Time.time * waveSpeed -> so I put a * instead of a + between waveFrequency and Time.time. Hope it helps !
Thank you for the tutorials. This is exactly what unity should have implemented years ago in a default "buoyancy collider". The number of likes in this video is not proportional to the quality of the information given... you need millions! These two tutorials should be the first result if you search "unity boat on water"... it just took me 1 year to find this information.... Once again, thank you!
there are a bunch of buoyancy methods but your method looks the most efficient and most cpu friendly way to do it. Great work!!!
*_Love the tutorials and love you game! I would love a tutorial on how you setup the lighting and atmosphere in your game (fog, floating particles...)._*
This needs more views, so good.
It's amazing, very cool tutorial
If you have objects floating like I did, try changing the WaterHeightAtPosition to
return ocean.position.y + displacementWaves.GetPixelBilinear(pos.x * waveFrequency* ocean.localScale.x, (pos.z * waveFrequency + Time.time * waveSpeed)*ocean.localScale.z).g * waveHeight;
It is more correct to put the multiplication of localScale.x,z inside the GetPixelBilinear, to take into account if you rescaled the x,z dimensions of your water plane.
Great tutorial though.
Cheers,
PetRem Labs
You are the MAN! That was the fix needed to properly scale with ocean plane scaling. Comes in handy when applying weather systems to smoothly change the scale of the waves. Thanks!!!
Mind blown thank you
Hey man, I'm having a problem with the bouys. For some reason is floating over the water
these videos are amazing why no comments btw can i have the water shader i already made one
and it isn't working with it
Thank you ! I don't have it anymore sadly... You should be able to copy it from the video though (from 2:28 of the first part of the tutorial, I show the node graph)
can you like write the code of ocean manager
@@abdurrazzaque8435 lol i switched game engines a few months ago
@@shrippie-4214 what did you switch to
@@catsEeter Godot
Thank You! i have learn a lot :)
Thank you so very much!
Amazing!
This is great but i'm having an issue. My cube just floats up way above the waves. I think the code is telling it the waves are much taller than the shader makes them appear. Code is 100% the same as yours and everything in Unity is set up the same. Maybe it has to do with the Normal Map? Guessing that because I know nothing about them and just grabbed some off the unity asset store.. Any ideas would be much appreciated!
EDIT: I Got it!!! My issue was my ocean plane game object had different scales for x / y / z. Once i changed them all to 100, the boat floated on the waves correctly. Hope this helps someone.
Check you water plan is in y = 0😀
This tutorial really helped me get my water physics working perfectly! I have a question though.
I'm generating my wave displacement using multiple sine waves and some gradient noise. The biggest thing I could use from this tutorial is the Texture.GetPixelBilinear function, but as you'd guess. I'm not using a texture to generate anything. But I need to get the info from the the shader of the height of each vertex. How would you recommend approching this? I've been researching documentation for a couple weeks now but can't think of anything that would get me something similar!
Did you figure anything out on this? Im also creating my waves this way, and need to get the wave height from the shader somehow to use in the script.
same here, i think that's why in the tutorial noise is generated outside the shader graph.
same fore me
How did you make that circular mesh thats more detailed near the middle?
Enjoying your tutorials. However same issue of objects falling thru the ocean @13:45
but the strings are the same. Any ideas?
Sgned up! Congratulations on your tutorials and your project! Will you take a tutorial on how to optimize a thick vegetation in HDRP? unfortunately there is really little stuff around...
Quick question, you use a normal map to make your water so you use an 2d texture lod node, in my shader, instead of using that I use a gradient noise node and it seems to do the same thing. so my issue is how do I reference that over how you're referencing the 2d te3xture?
Did you find answer?
@@sollner_fox no, sadly... kinda sucks but hey all good
@@iR3dy Maybe normal from height node? The problem is that the normal will be pixelated when using that node.
It's not working with mesh colliders unless I freeze x,y,z rotations in the rigidbody constraints which won't be a good solution.
Did you find a fix for this?
@@MrApollo_ I'm also looking into it.
Hello! if there's anyone experienced enough or knows how to get by this please help! I already have an ocean shader and all the variables are managed through the material on the ocean. I've tried implementing the ocean manager script and I simply can't get it to work. The video I followed was: How to implement Gerstner Waves with Shader Graph in Unity by Zicore. If anyone can help match the variables to the buoyancy script in this video, please respond.
Is your shader available for free?
🔥🔥🔥🔥
Any chance you could make a boat/sail mechanics tutorial to go with this? i've been trying to figure out boat movement and it hurts my brain
Shouldnt it just be like a regular character controller ? I imagine you just connect the floaters on to each corner of the boat and thats it
@@blanketparty5259 Yeah I've done some tests and researched since then, a normal ridgedbody character controller works fine \m/
can someone like write the code of ocean manager
do you have source code or a unity project available?
Can u plsssssssssssssssssssssssssss give a link for the project?
So I think I did everythiright, but the things float way higher, it's like the point that they should be at is multiplied by something? can anyone help?
try reducing the water height
@@N0tTh3Pr0 The problem is: water height 0, acts like no waves, I put waterheight to 10, and the wave is at y 7 for example, the thing is trying to float at 14, if water is 14 it tried to float at 28, not with theese numbers, but you get the point
People that are having problems with scaling just use two planes set the main one to 1:1:1 and hide it, make the visible one as big as you want but make sure y scale is 1 and that will fix your problem
Shame this can't be done with regular unity. I tried to install that render pipeline and it balls up my project and pissed away 5 hours. Thank god i saved a copy before i started
there are better ways to do 3D waves any way. the physics in this video can be done with any version of Unity.
Can this work with urp?
It's cool, but in the first tutorial he shouldn't have did a time laps
Where r u ?
Could you simuling a ship launching go down into slope 1° o 3° to sea o river. Ship length about 72m and airbags put down the ship (rotating + cinematic) moving?. Here include gravity force!
How do I add underwater and foam and caustics
damn can someone send the project pls i tried doing this 4 times and all of them had something wrong with them(never did textures and shaders)
yeah i second that.
u have to make the shaders so it works
the objects go to high and idk how to fix it
Did you fix that?
same issue floaters move way slower than the waves and stay higher
Actually I fixed it, but i don't know if it is the same problem for you. In the WaterHeightAtPosition method, I misswrote the formula, instead of putting position.z * waveFrequency + Time.time * waveSpeed, I put position.z * waveFrequency * Time.time * waveSpeed -> so I put a * instead of a + between waveFrequency and Time.time. Hope it helps !
can someone like write the code of ocean manager
Can u plsssssssssssssssssssssssssss give a link for the project?
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
Can u plsssssssssssssssssssssssssss give a link for the project?
Can u plsssssssssssssssssssssssssss give a link for the project?
can someone like write the code of ocean manager
OH MY LORD STOP SPAMMING
@@catsEeter NO ONE IS SAYING THE CODE
@@abdurrazzaque8435 I DONT CARE BUT STOP ITS ANNOYING TO OTHERS
@@catsEeter IGNORE IT
@@abdurrazzaque8435 JUST STOP
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager
can someone like write the code of ocean manager