[Community Project] FREE Ocean Water Shader

for water in boat, I was reading about a solution related to “Stencil Buffer”. Somehow they created two meshes for boat, one for external, one for internal and disabled rendering water with help of external mesh and stencil buffer but I dont know the details.

I have never seen this behavior before… Did you disable the Landscape modulation at BP_Ocean? Disable it if you don’t.

I have posted a video about the use of stencil, but it won’t work out of the box as it was explained, because the underwater effects also use the stencil to work, so it will take a bit more changes than the ones I have explained in the video, but as I said I am looking into this.

Yes, its disabled. Also, it seems as I tweaked wave speed, amplitude and other values to get smaller waves, buoyancy still exist but seems waves dont inflict the ship or its is too small to notice. (Though I tried set smaller mass scale and smaller density for my light boat to get more intense buoyancy.)
Another wierd problem if I use two ocean BPs on scene, for two lakes. Even if I set the correct Ocean Manager reference for different boats, the sample boat seems still checks the another one, or no idea why it floats far above the ocean plane.

I think the system was really not made to be used like lakes and I am almost sure someone tried this before and never made it to work properly and gave up. It would be less troubling implement buoyancy on another asset … there is even a guy who implemented a simple one which works nice, you could try this: 3D Projects - Elhoussine Mehnik

He has two projects implementing buoyancy, one for ships and one which is simple buoyancy. It worth check them out.

Follow a video with a discussion on why just following the methods using stencil in the ocean material is not working as expected and the next steps I will take to make it work:

Hi Nilson.

I’ve never logged on to these forums to post before (only to read and learn). But having downloaded and started integrating this in to my game I felt I had to post a thank you. This is an incredible asset that you and the team have made available, for free, to the masses. I had a few issues with getting it to work (masking in particular), but you’ve set out to help people with that as well. Genuinely can’t thank you enough!

Also I didn’t realise how much I needed this in my project until I opened up the project and watched those rolling waves… amazing work!

For the masking I found that if I set the UnderwaterPPVolume on the BP_Underwater that it would then take away the masked effect, and even if I did an undo it would still be gone. I’d have to close the map and re-open it without saving the changes. I don’t know if that indicates anything to you in terms of issues people may have been having?

Super helpful and it’s pretty much perfect! Thank you so much for this, you’ve spared me lots and lots of hours of work on one of my projects.

The last video posted above just discuss that masking and underwater postprocess don’t work together as it is. It will be necessary a total rework on that, because the project used stencil for doing the underwater and unfortunately that conflicts with the masking which would use it too, and also there is no way to prioritize which will use it first, because the interior of a big ship or a submarine would be submerged and you want to see the underwater out of it while seeing the interior water free.

This is currently on top of my priority list regarding this project and as soon I have a bit of time I will dig into this.

My first attempt on UE 4.22 preview 3 was not a good experience. There are visually several differences, mostly regarding illumination, planar reflections, surface is too flat, changes on lights crash, changes on ocean type crash, so maybe will be mentally healthier wait to the final 4.22 release instead of trying fixing things as it is for now. The errors are not in the plugin portion, so this is good news. There is a portion of code inside Advanced Buoyancy (because of changes on the rendering module) which will deprecate in 4.23, meaning a simple recompilation won’t work until the code is fixed and I hope to leave this fix done in 4.22 before 4.23 coming out. I will still send bug reports to Epic as much as I can, so I hope they don’t rush the release before fixing the issues.

Thank you all for keeping this project afloat, recently added the Ocean to my 4.21.2 project. The entire process took only about 20 minutes (including compilation of shaders). Looks very realistic, exactly what I needed.

Thought. It would be nice to have sea ice too, currently I model the landscape close to the water surface, but the waves lap over it. Not a big issue, maybe I try adding a buoyancy mesh, shaped like ice. With big waves and depending on the sea ice thickness, you could also expect sea ice parts breaking up, rafting over each other, so this opens another layer of possibilities…

does anyone know how to make an AI boat in this? get them to move to a set location

I never did myself (AI and stuff), but if you move the PlayerStart to one of the small boats and press ‘E’ (a message appears when you are in the right spot) you take control of the boat and can drive it. It is then a matter of checking what the code does (it is in blueprint) and use as a base for the AI boats.

I’m not that great myself :\ was hoping there was an easy way, or one already working

Give me week or two and I will sort this out. I need to review the whole AI thing again so at least I can do it properly with best practices in mind. Likely to post a video.

sweet can’t wait :slight_smile:

I have just committed an update for anyone wanting to test with UE4.22 preview 4 available at Epic Launcher. There were some adjustments necessary for the planar reflections (which touching it too much may lead to a crash). Don’t forget to submit any crash report to Epic to help the devs to fix bugs when they appear!

https://github.com/UE4-OceanProject/OceanProject/tree/OceanProjectNilsonLima

Any luck with the ai boats?

There’s an AI boat in this awesome guys boat physics project. You can use, adapt it, or learn from it.