# \[Community Project\] FREE Ocean Water Shader

**URL:** <https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372>\
**Category:** Game Development\
**Tags:** unreal-engine\
**Created:** [August 22, 2018, 11:00pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372 "2018-08-22T23:00:54Z")\
**Posts on this page:** 20\
**Page:** 5

<div class="post-metadata">

**Author:** ![NilsonLima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NilsonLima](https://forums.unrealengine.com/u/NilsonLima)\
**Post date:** [January 1, 2019, 2:19pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/83 "2019-01-01T14:19:30Z")

</div>

> [@Dreamcastgamer](#):
>
> Seems like a few years ago some people where able to get a wake function on the ocean, was wondering if this was ever documented or instructions made for it?  
> [https://forums.unrealengine.com/comm…-shader/page48](https://forums.unrealengine.com/community/work-in-progress/17331-community-project-wip-weather-ocean-water-shader/page48)

The feature is broken. Something happened when new engine releases came in and nobody noticed that the wakes were not visible anymore. When you posses a bot with ‘E’ key and you move it, you can see the BP\_Wake actors being spawned and destroyed, but they are not visible. There is a camera position I discovered that you can see the wakes visible, but any change they go poof again.

The method is consistent, but it would be necessary to look the last engine version this worked as it should and start to compare engine source code changes that made this behavior to happen, takes a huge amount of time, which I don’t have right now.

PS: I have figured out the issue and will post the changes needed with a small video. It is just a translucency sorting issue.

---

<div class="post-metadata">

**Author:** ![NilsonLima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NilsonLima](https://forums.unrealengine.com/u/NilsonLima)\
**Post date:** [January 1, 2019, 4:37pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/84 "2019-01-01T16:37:38Z")

</div>

> [@Dreamcastgamer](#):
>
> Seems like a few years ago some people where able to get a wake function on the ocean, was wondering if this was ever documented or instructions made for it?  
> [https://forums.unrealengine.com/community/work-in-progress/17331-community-project-wip-weather-ocean-water-shader/page48](https://forums.unrealengine.com/community/work-in-progress/17331-community-project-wip-weather-ocean-water-shader/page48)

The video showing the feature explanation and the fix can be found here:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/7/ff75878c98e8cf78e949b2d6daf4731ef5c3f757.jpeg "UE4 - Community FREE Ocean Project - Foam wakes") ](https://www.youtube.com/watch?v=LKc502JuPno)

---

<div class="post-metadata">

**Author:** ![Thunder\_Owl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thunder\_Owl](https://forums.unrealengine.com/u/Thunder_Owl)\
**Post date:** [January 1, 2019, 9:55pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/85 "2019-01-01T21:55:46Z")

</div>

> [@NilsonLima](#):
>
> The video showing the feature explanation and the fix can be found here: [https://youtube.com/watch?v=LKc502JuPno](https://youtube.com/watch?v=LKc502JuPno)

Thank You !

---

<div class="post-metadata">

**Author:** ![sstefan4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sstefan4](https://forums.unrealengine.com/u/sstefan4)\
**Post date:** [January 2, 2019, 3:56pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/86 "2019-01-02T15:56:05Z")

</div>

> [@NilsonLima](#):
>
> Buoyancy only happens if you use the specific blueprint for it otherwise nothing will break. In theory you can use the material for the ocean in a plane with some tessellation on it if you want to have a small portion of the ocean showing into the scene, otherwise you will still need the C++ portion of the plugin to handle the infinite ocean system, which automatically scales a plane for you depending on the camera position and distance.
> 
> If you still think you are uncomfortable doing changes I would suggest picking the free Water Materials available in the marketplace, they have an ocean material which is quite nice, and you can change it to have the coloring we have in the community project by copying the relevant nodes from this to the Water Materials’ ocean material.

the thing is that the oceanmaterial from marketplace dosent have edge foam and deep fade

---

<div class="post-metadata">

**Author:** ![NilsonLima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NilsonLima](https://forums.unrealengine.com/u/NilsonLima)\
**Post date:** [January 2, 2019, 4:49pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/87 "2019-01-02T16:49:44Z")

</div>

> [@Estebantr](#):
>
> the thing is that the oceanmaterial from marketplace dosent have edge foam and deep fade

Just to be sure we are talking about same FREE asset: [Water Materials in Materials - UE Marketplace](https://www.unrealengine.com/marketplace/water-materials)

---

<div class="post-metadata">

**Author:** ![sstefan4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sstefan4](https://forums.unrealengine.com/u/sstefan4)\
**Post date:** [January 2, 2019, 6:07pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/88 "2019-01-02T18:07:16Z")

</div>

lmao i didnt know that actually exist , i thought it was the ue4 demo . thanks!

---

<div class="post-metadata">

**Author:** ![Dreamcastgamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dreamcastgamer](https://forums.unrealengine.com/u/Dreamcastgamer)\
**Post date:** [January 3, 2019, 5:35am UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/89 "2019-01-03T05:35:13Z")

</div>

> [@NilsonLima](#):
>
> The video showing the feature explanation and the fix can be found here: [https://youtube.com/watch?v=LKc502JuPno](https://youtube.com/watch?v=LKc502JuPno)

Thanks for that fantastic video! Your video’s are always very informative! Got it working in the default map and it works great!

I was wondering though if i could ask a question though

So as you might have seen in the quick video i posted im obviously using a waaayyy different model than the default fishing boat one.

For in my game this mesh/actor is not controlled by the player but instead is on a pre set path i animated in Matinee (i never liked sequence editor myself)  
For the example in the default maps this is on a blueprint/actor that only is effected by a user’s input, would you have any idea on how to get it working on a different model?

My thought process is that maybe one could take the fishing boat blueprint and change the meshes around in it and get rid of the controlling aspect, not too sure if that work though

Again thanks for the fantastic video!

---

<div class="post-metadata">

**Author:** ![sstefan4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sstefan4](https://forums.unrealengine.com/u/sstefan4)\
**Post date:** [January 3, 2019, 6:02am UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/90 "2019-01-03T06:02:23Z")

</div>

> [@NilsonLima](#):
>
> Just to be sure we are talking about same FREE asset: [Water Materials in Materials - UE Marketplace](https://www.unrealengine.com/marketplace/water-materials)

Its kind of lame but i cant setup the material in my level landscape , dosent looks the same (white water and 0 realism , tiny foam etc) as in the overview level of the asset any idea what should i do?

---

<div class="post-metadata">

**Author:** ![NilsonLima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NilsonLima](https://forums.unrealengine.com/u/NilsonLima)\
**Post date:** [January 3, 2019, 10:07am UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/91 "2019-01-03T10:07:10Z")

</div>

> [@Estebantr](#):
>
> Its kind of lame but i cant setup the material in my level landscape , dosent looks the same (white water and 0 realism , tiny foam etc) as in the overview level of the asset any idea what should i do?

In this case you need to ask for support for that asset’s creator. The asset is free, but he received US$ 7,500 from Epic to sponsor that asset, so kinda free for us, but creator was paid and needs to give support.

---

<div class="post-metadata">

**Author:** ![Dreamcastgamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dreamcastgamer](https://forums.unrealengine.com/u/Dreamcastgamer)\
**Post date:** [January 5, 2019, 12:43am UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/92 "2019-01-05T00:43:42Z")

</div>

I was experimenting around today and i was wondering if its possible if one can take the Wake stuff from the fishing boat (where its spawning and then deleting itself) and make it its own blueprint that is constantly making wakes. This would allow it be treated say like a smoke system where one can attach it to a actor so it following it at all times.

This could be a cool way of adding it to non playable objects, like something in a sequence or cut-scene.

Be cool if that could be done

---

<div class="post-metadata">

**Author:** ![script526](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@script526](https://forums.unrealengine.com/u/script526)\
**Post date:** [January 8, 2019, 2:49am UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/93 "2019-01-08T02:49:38Z")

</div>

Hi Nilson Lima!

 ![1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/a/7/a74d6825d04ee01d59e8be8dbc844fd10aa89882.jpeg)

Quick question about the Ocean. I’m trying to remove water from the inside of my ship and I found on forums a few possible ways to do it.

First way is by using a DepthFade node:

[https://wiki.unrealengine.com/Visual…ing\_Depth\_Fade](https://wiki.unrealengine.com/Visual_Effects:_Lesson_02:_Using_Depth_Fade)

Second is by using stencil:

[https://answers.unrealengine.com/que…-logic-pu.html  
https://answers.unrealengine.com/questions/575373/hiding-water-surface-inside-a-boat.html](https://answers.unrealengine.com/questions/461081/mask-different-meshes-with-custom-stencil-logic-pu.html)

The third is by using DistanceToNearestSurface node:

[https://answers.unrealengine.com/questions/461081/mask-different-meshes-with-custom-stencil-logic-pu.html](https://answers.unrealengine.com/questions/461081/mask-different-meshes-with-custom-stencil-logic-pu.html#4)

So, for now I tried using only DepthFade but it doesn’t work for some reason. Basically the ocean material I am using (M\_Ocean\_Ultra) is pretty complex and I am not sure if I understand how to add some kind of new opacity rules without breaking the whole material.

Therefore, just wanted to ask if you maybe have encountered this issue by any chance or you have some piece of advise how to find better and the simplest way to remove water from the ship?

Any help would be appreciated.

Best,  
Alexander Alikin

---

<div class="post-metadata">

**Author:** ![NilsonLima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NilsonLima](https://forums.unrealengine.com/u/NilsonLima)\
**Post date:** [January 8, 2019, 11:20am UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/94 "2019-01-08T11:20:50Z")

</div>

@script526

Depth Fade would do the trick, but won’t work on all scenarios, meaning different tweaks for one material (ocean material) which you would need to activate depending where you are in the scene.

DistanceToNearestSurface works fine for postprocess and underwater (since you can stack material instances at the postprocess with different objects to mask). For the ocean material, simple things like a boat when moving the camera far from it, will generate tiny numbers and the water will fill the interior again. It would work for an interior the the length of flooded area is not too big, otherwise you will see water appearing as artifact. Distance Fields by default is low resolution and you would need to setup each mesh with a better one for tweaking, meaning a lot of work.

The best possible solution is with stencil, it would give less work in general and the result is the expected elsewhere, it is more difficult to set, so I will work on some changes in the project, and make a video showing how to use this solution. I think it is in the best interest for people how the solution is done, instead of giving it done in the code already, so people have the chance to learn in the process. I will do the same approach as the foam wakes, showing the issue and where to change in a step-by-step.

---

<div class="post-metadata">

**Author:** ![NilsonLima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NilsonLima](https://forums.unrealengine.com/u/NilsonLima)\
**Post date:** [January 8, 2019, 4:24pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/95 "2019-01-08T16:24:06Z")

</div>

New year, new goals, to simplify and not having fixes dispersed into several videos (I will still make them, so people learn how to fix stuff) I will update this project into an specific branch which I will have full control, so start copying from it: [https://github.com/UE4-OceanProject/OceanProject/tree/OceanProjectNilsonLima](https://github.com/UE4-OceanProject/OceanProject/tree/OceanProjectNilsonLima)

---

<div class="post-metadata">

**Author:** ![script526](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@script526](https://forums.unrealengine.com/u/script526)\
**Post date:** [January 8, 2019, 6:12pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/96 "2019-01-08T18:12:37Z")

</div>

@NilsonLima]([https://forums.unrealengine.com/member/365555-nilsonlima](https://forums.unrealengine.com/member/365555-nilsonlima)) Learning is much better than using someone’s solution without understanding how it works. So I look forward to check out your video. And by the way the video about setting up foam behind the moving boat is absolutely great. I like the way you consciously run into problems in order to show how to fix them.

---

<div class="post-metadata">

**Author:** ![NilsonLima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NilsonLima](https://forums.unrealengine.com/u/NilsonLima)\
**Post date:** [January 8, 2019, 6:26pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/97 "2019-01-08T18:26:18Z")

</div>

> [@script526](#):
>
> @NilsonLima]([https://forums.unrealengine.com/member/365555-nilsonlima](https://forums.unrealengine.com/member/365555-nilsonlima)) Learning is much better than using someone’s solution without understanding how it works. So I look forward to check out your video. And by the way the video about setting up foam behind the moving boat is absolutely great. I like the way you consciously run into problems in order to show how to fix them.

This is how I do to train my collaborators in projects. Explain the project, show the issues/flaws, show the related code, dig into the fix = best way of learning.

---

<div class="post-metadata">

**Author:** ![Trevelin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Trevelin](https://forums.unrealengine.com/u/Trevelin)\
**Post date:** [January 9, 2019, 12:07pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/98 "2019-01-09T12:07:59Z")

</div>

> [@NilsonLima](#):
>
> New year, new goals, to simplify and not having fixes dispersed into several videos (I will still make them, so people learn how to fix stuff) I will update this project into an specific branch which I will have full control, so start copying from it: [https://github.com/UE4-OceanProject/OceanProject/tree/OceanProjectNilsonLima](https://github.com/UE4-OceanProject/OceanProject/tree/OceanProjectNilsonLima)

Tank´s Nilson Lima, precisava muito !!!

---

<div class="post-metadata">

**Author:** ![Trevelin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Trevelin](https://forums.unrealengine.com/u/Trevelin)\
**Post date:** [January 9, 2019, 12:17pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/99 "2019-01-09T12:17:36Z")

</div>

> [@NilsonLima](#):
>
> This is how I do to train my collaborators in projects. Explain the project, show the issues/flaws, show the related code, dig into the fix = best way of learning.

Nilson Lima, entrei no seu perfil, imaginando sua nacionalidade Brasileira, mas de Santo André, muita **coincidência, Tambem Sou, Rs**

---

<div class="post-metadata">

**Author:** ![script526](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@script526](https://forums.unrealengine.com/u/script526)\
**Post date:** [January 13, 2019, 4:39am UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/100 "2019-01-13T04:39:09Z")

</div>

Hey Nilson!

I’ve checked out your last video about masking water out of the objects.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/e/34e76b754567ab3fbbd15cdf50d07c32ba10a009.jpeg "UE4 - Masking Objects covered by water") ](https://www.youtube.com/watch?v=69YfV8ru-ZM)

Thank you very much for your help. I’ll try two methods you explained and give you a feedback.

---

<div class="post-metadata">

**Author:** ![NilsonLima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NilsonLima](https://forums.unrealengine.com/u/NilsonLima)\
**Post date:** [January 14, 2019, 1:13pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/101 "2019-01-14T13:13:48Z")

</div>

> [@script526](#):
>
> Hey Nilson!
> 
> I’ve checked out your last video about masking water out of the objects.
> 
> [https://www.youtube.com/watch?v=69YfV8ru-ZM](https://www.youtube.com/watch?v=69YfV8ru-ZM)
> 
> Thank you very much for your help. I’ll try two methods you explained and give you a feedback.

I didn’t have the changes on the Community Ocean done yet, because the material are more complex and also there is the underwater material to deal aswel. I want also to see if I will prepare a boat mesh specific for having this into the project or if I will modify the current boats/ships in order to have them all working. It just takes more time.

---

<div class="post-metadata">

**Author:** ![PerseusSmith](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PerseusSmith](https://forums.unrealengine.com/u/PerseusSmith)\
**Post date:** [January 14, 2019, 9:44pm UTC](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372/102 "2019-01-14T21:44:03Z")

</div>

The Ocean Project is great, but there is an issue with the

- **Ecliptic Longitude** ]([Ecliptic coordinate system - Wikipedia](https://en.wikipedia.org/wiki/Ecliptic_coordinate_system)): The longitude location of the moon on the celestial sphere.
- **Ecliptic Latitude** ]([Ecliptic coordinate system - Wikipedia](https://en.wikipedia.org/wiki/Ecliptic_coordinate_system)): The latitude location of the moon on the celestial sphere.

We just need tighter approximations for it to actually result in an eclipse, which would be cool.

[Previous page](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372.md?page=4)

[Next page](https://forums.unrealengine.com/t/community-project-free-ocean-water-shader/115372.md?page=6)
