[Community Project] FREE Ocean Water Shader

Also tried “Weather-Simulation” branch of ComputeShaderDev, there are also errors:

When rebuilding, plugins are built sucessful, but after that, the editor gets stuck when loading the project at 95%, and after some time it crashes.

This is the relevant part of the log:

[2018.11.04-11.11.26:837] 0]LogWindows: Error: === Critical error: ===
[2018.11.04-11.11.26:837] 0]LogWindows: Error:
[2018.11.04-11.11.26:837] 0]LogWindows: Error: Fatal error: [File:D:\Build++UE4\Sync\Engine\Source\Runtime\ShaderCore\Private\ShaderParameters.cpp] [Line: 25]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: Failure to bind non-optional shader parameter numSteps! The parameter is either not present in the shader, or the shader compiler optimized it out.
[2018.11.04-11.11.26:837] 0]LogWindows: Error:
[2018.11.04-11.11.26:837] 0]LogWindows: Error:
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fffb903a388 KERNELBASE.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fffa25b6850 UE4Editor-ApplicationCore.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fffa2b962fc UE4Editor-Core.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fffa2b251db UE4Editor-Core.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff9b77291f UE4Editor-ShaderCore.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff729d4594 UE4Editor-ComputeShaderDevPlugin.dll!FGlobalComputeShader::FGlobalComputeShader() [plugins\computeshaderdev\source\computeshaderdevplugin\public\shader_interface.h:95]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff729d5254 UE4Editor-ComputeShaderDevPlugin.dll!FGlobalComputeShader::ConstructCompiledInstance() [plugins\computeshaderdev\source\computeshaderdevplugin\public\shader_interface.h:50]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff3cc5519d UE4Editor-Engine.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff3cc75185 UE4Editor-Engine.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff3cc77bce UE4Editor-Engine.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff3cc74610 UE4Editor-Engine.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff3fc31e07 UE4Editor-UnrealEd.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff3fc22005 UE4Editor-UnrealEd.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff3fc05325 UE4Editor-UnrealEd.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff404780be UE4Editor-UnrealEd.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff3ffae174 UE4Editor-UnrealEd.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff3ffadf63 UE4Editor-UnrealEd.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff4048fd7b UE4Editor-UnrealEd.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007fff40476893 UE4Editor-UnrealEd.dll!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007ff7128d5a34 UE4Editor.exe!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007ff7128d5bba UE4Editor.exe!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007ff7128e3dac UE4Editor.exe!UnknownFunction ]
[2018.11.04-11.11.26:837] 0]LogWindows: Error: [Callstack] 0x00007ff7128e5aaa UE4Editor.exe!UnknownFunction ]
[2018.11.04-11.11.26:838] 0]LogWindows: Error: [Callstack] 0x00007fffbb923034 KERNEL32.DLL!UnknownFunction ]
[2018.11.04-11.11.26:838] 0]LogWindows: Error: [Callstack] 0x00007fffbc0f1471 ntdll.dll!UnknownFunction ]
[2018.11.04-11.11.26:838] 0]LogWindows: Error:
[2018.11.04-11.11.26:850] 0]LogExit: Executing StaticShutdownAfterError
[2018.11.04-11.11.26:852] 0]LogWindows: FPlatformMisc::RequestExit(1)
[2018.11.04-11.11.26:855] 0]Log file closed, 11/04/18 12:11:26

The folder ComputeShaderDevPlugin you can delete it from the plugins folder. It was added there some time ago by Dotcam by mistake. Indeed those changes you mentioned about the include path are necessary, I have found a version which packaged ok and I will add a comment here about it. Unfortunetely as Dotcam is MIA we can’t handle the repository, so I think we will have it duplicated or create a branch to have the asset moving forward.

I added the ComputeShaderDev plugin, this can be removed, it was just a proof of concept, and I’m not working on it right now. User’s should be using the 4.19 stable branch anyways.

As far as I know, I have access to the repository. While RL issues has kept me really busy, if you open a Pull Request with the fixes, I can merge it easily.
I won’t be able to fix those issues by myself for a while yet, but I can happily merge PRs :slight_smile:

I apologize for not being able to add fixes on my own, like in the past - it will be a few more weeks until I can get back to code fixing :frowning:

I finally did a PR adding support for 4.20:

Hope it helps someone!

@NilsonLima For some odd reason In the example island map the ocean will either adjust to the terrain or just have huge waves that pass through with no shoreline. Adding everything from that map with copy & paste to mine produces the same result no matter what settings get changed. Not sure why it can’t see edges of my island

Does this build to 4.21 too?

Successfully got it working on the latest version of the engine

If you check at the BP_Ocean, in the parameter section called Ocean Manager, you will find the parameters which deals with landscape modulation. Those parameters will tell how the ocean material will behave to flatten the waves the more it approaches the terrain. Of course that if you are doing with a completely different landscape, the proper parameters for that should be feed, like Landscape (your current map) and the Heightmap Texture which should be an image of you height map obtained from the software you used to create your landscape (ie: WorldMachine). Also the Z for the landscape is used and I would tell you to notice it on the example map aswel.

Let me know about your findings after the hints above.

I exported the height map and selected both inside the BP. So I found where the water is calm but it’s way off to the side of the Landscape

Which is the resolution for the exported map (the texture) and which is the resolution got when you imported your map into UE4? All these matters.

Hello I was wondering if some could help, I would like to set a ocean, and more simplified version of yours, with basic buoyancy and maybe transparency in shallow waters, I would like to use my own material but use your set up, I really don’t need half your options, I have modified the material to use your wave Functions but I cant seem to work out how to use the material on your project.
thanks for your time

You need to study deeply the assets inside the project and in a separate copy you need to start stripping out what you don’t need. Or you can just give up on it and use some effects into your own project.

Buoyancy is nothing more that set points along a mesh and to apply physics force on them determined by the wave height at the position for that point set in the mesh. A brief study in the buoyancy actor blueprint would make that clear and it is very simple. There is an old video which sort of explain this (it might not be that accurate with the current version but it is enough as a starting point and to understand the concept: https://youtube.com/watch?v=kkxJeyG2whw

Thanks, I have Watch the Vid, and a few other ones about this topic, it’s only the Code (C++) I don’t understand I don’t know what to do with it, where to put it, the rest I can work out, I can get the BPs to talk to each other I know how to make the Material talk to a BP. I am getting a understanding of how it all works. But the Code I do not know what to do with, I looked at the Wiki and it don’t make sense to me, I have never done it before, I have really only worked with unreal and BPs.

thanks for the help

I re-imported and then it worked fine, I added more to the generated landscape and I think that was part of the issue. Thanks for your help. My next question is that I have models for an underground passage how can I stop the water from passing through that?

I have a video explaining the basics on masking an area and change the postprocess and/or the ocean material if needed to clean out the underwater and/or ocean surface respectivelly. Did you watch any videos I have published? This is the one I am talking about:

I think that if you don’t understand or don’t ever want to understand C++ then this project is not for you, because to change it to fit your needs it is important to be willing to learn this. I can recommend to you the Physical Water Surface available at the Marketplace which is a blueprint only solution and which has buoyancy aswel Gerstner waves. You can get some nodes from the ocean material and add to that material for it to work with translucency and I think that asset wiki tells how to do so.

I have not seen that video yet, thank you. I need to stop the water surface from passing through not the post process, is there a way to do that?

you right in some sense I don’t want to become a C++ expert, but that’s different to not wanting to understand it some what, look to be honest, as you are to me, your response is pretty typical of responses I see in the Forums and such Places related to UE4. no one never really answers questions (or some what easy questions) they are always cryptic answers that is never the whole answer but part of it when it could probably be answered in full with as much time and effort, it is a bit of a superiority complex with most responses on the UE4 forums as a hole(not saying that you do it all the time or at all) , " I know the answer but I don’t want to tell you the answer, or I am not going to tell you the full answer, to make you watch some Video that you probably have look at already and want to move on from that", I don’t know if most people mean it or not I can not work it out, and you seem like a helpfully person. its just my opinion and please don’t take it personally.

anyway thanks for the advice about the marketplace product, I did want to try and make one myself, and the assets only $50 so I might cheek it out, if I cant get your system to work with what I want to do, thanks for you time

Don’t get me wrong in the sense that my answer might sound not exactly the answer you wanted or sounded rude in any sort. I for once was in the same spot as you, wanting to understand this asset the first time I put my eyes on it, and I expended a lot of time doing this, basically because when a new engine release was launched and something changed in the engine that make the code break I was not able to use it anymore, therefore I had to study it deeply. That is a perspective for one with at least some C++ knowledge. This project was given by @DotCam for free in 2014 and it received a lot of contributions along the way from different persons. Now DotCam is MIA for some reason and we know he was not in good health for quite some time, then I thought at first since the original thread was receiving a lot of questions and nobody to answer, that one way for me to contribute to it was giving answers or directions, which I think I quite achieved by creating a lot of videos explaining how to do things with the asset as you can see in this Youtube playlist: https://www.youtube.com/playlist?lis…DFqSmCqo5bo5qm.

I myself was always willing to create an ocean asset since the beginning and I am in continuous research for this and I am using the amount of questioning and difficulties people have with this FREE project to enhance my own make it more easy to use, so I think the balance between what I want to receive from this project and what I can give is quite ok by now. I think that people want to know where the heck of the knowledge to come to build an asset like this come from, so there will go:

Gerstner Waves: https://developer.nvidia.com/gpugems/GPUGems/gpugems_ch01.html
Tessendorf FFT Waves : https://people.cs.clemson.edu/~jtessen/papers_files/coursenotes2004.pdf

So, if you take your time to read those papers and check the code you will find that those formulas are used in this project (Gerstner ones), my project will use the FFT one, and besides the knowledge is written using math, this knowledge needs to be converted to the game engine of choice, our case is UE4 translated into material (using a graph) and sometimes shaders (which uses a similar C++ notation). This FREE project uses C++ to generate the Infinite Ocean System, the Physical Water Surface uses same approach for Infinite Ocean System but using blueprints instead of C++. It is possible after some work to make the Physical Water Surface to look exactly as this FREE project, but needs that the person is willing to study and understand both assets if they want something customized.

I hope this clarifies the why things are like this.