No announcement yet.

[Community Project] WIP Weather & Ocean Water Shader

This topic is closed.
  • Filter
  • Time
  • Show
Clear All
new posts

    TK-Master, I appreciate your contribution on this, I think you are in the right track

    UE4 absolutely needs a good dynamic water shader (ocean, lake and rivers).
    The current options are simply terrible, some just looks like a melted thinfoil, others looks like a perfect colored mirror ,
    even lumion 1.0 had a better ocean shader than UE4 today (almost 7 years ago):
    hell, even unreal engine 3 in 2005 had some advanced dynamic water shaders, 11 years ago!!!
    So please Epic, make this happen, a good believable water shader is very important in game design specially on Archviz.


      is it possible to use this in ark?


        I know this is stupid of me but someone said it wouldn't cook and package for them a while back and I said I'd try. I just downloaded the project fresh off github and tried to cook n package (tried oceanexamplemap01 and the entire project) but it failed with code 25, anda ton of ocean material warnings, path warnings.

        Tried a sample c++ project I've been working on and cooked n packaged no problem, tried a bp third person template, no issues. Win 64.

        Ideas. I can post the output log.

        Edit it appears because the old sky BP fails to compile or whatever in the level BP in OceanExample01 you need to replace the skydome with the new one and the new hud. Works fine.

        Edit2: I'm getting 17-25 fps average on the stock project in 4.12, any ideas why? I used to get 60-120, gotta be planar reflections the last time I packaged up a stock download off github it was silky crazy high fps. this is on a 760m(obile). must be planar reflections? will do some testing.

        [2016.07.28-01.28.16:380][996]LogChartCreation: 142 frames collected over 8.38 seconds, disregarding 0.00 seconds for a 16.94 FPS average
        Last edited by Nsomnia; 07-27-2016, 09:52 PM.
        Tek LLC a personal Candaian Company running BlenderTek & UnrealTek is currently looking for help to bring back submarine simulator gaming with a new genre of sub sims: Cold War! (1945-1991) Operation: Trident SubSim Dev Diary Thread - Donations


          I figured I should post my findings for anyone who might be interested about this stuff. [MENTION=10267]Handkor[/MENTION]

          After spending a few days experimenting with various ideas and normal interpolation methods I ended up using bicubic B-Spline interpolation, it's considered to be on the blurry side out of all the bicubic methods but it's the only one I found that can completely eliminate pixelation artifacts even with really low-res maps (like 64x64) so it's a perfect fit in this case.

          Linear interpolation between the 3 triangle vertex normals (using barycentric coordinates) doesn't seem to smooth it at all for whatever reason.

          Quick comparison screens between trilinear texture sampling and bicubic.
          Click image for larger version

Name:	trilinear-fluid.jpg
Views:	1
Size:	50.2 KB
ID:	1112797

          Click image for larger version

Name:	bicubic-fluid.jpg
Views:	1
Size:	43.8 KB
ID:	1112798

          That's a huge difference if you ask me! in this case it makes a 128x128 normal map look like 4k.

          Here is the custom node code for bicubic sampling.
          Required inputs: Tex, UV
          float2 res;
          Tex.GetDimensions(res.x, res.y);
          UV = UV*res-0.5;
          float2 index = floor(UV);
          float2 fraction = frac(UV);
          float2 one_frac = 1.0 - fraction;
          float2 one_frac2 = one_frac * one_frac;
          float2 fraction2 = fraction * fraction;
          float2 w0 = 1.0/6.0 * one_frac2 * one_frac;
          float2 w1 = 2.0/3.0 - 0.5 * fraction2 * (2.0-fraction);
          float2 w2 = 2.0/3.0 - 0.5 * one_frac2 * (2.0-one_frac);
          float2 w3 = 1.0/6.0 * fraction2 * fraction;
          float2 g0 = w0 + w1;
          float2 g1 = w2 + w3;
          float2 h0 = ((w1 / g0) - 0.5 + index) / res;
          float2 h1 = ((w3 / g1) + 1.5 + index) / res;
          float3 tex00 = Texture2DSample(Tex, TexSampler, h0);
          float3 tex10 = Texture2DSample(Tex, TexSampler, float2(h1.x, h0.y));
          float3 tex01 = Texture2DSample(Tex, TexSampler, float2(h0.x, h1.y));
          float3 tex11 = Texture2DSample(Tex, TexSampler, h1);
          tex00 = lerp(tex01, tex00, g0.y);
          tex10 = lerp(tex11, tex10, g0.y);
          return lerp(tex10, tex00, g0.x);

          4.10 Update! -> [Community Project] WIP Weather & Ocean Water Shader
          WIP Interactive Water Shader, WIP 2D Water Sim
          WIP FFT Ocean w/ Foam, Quad-tree Infinite Ocean LOD


            Wow [MENTION=1127]TK-Master[/MENTION] that is a huge difference. It looks fantastic.


              How long before we can possibly see this implemented into the ocean shader too?

              Also, how would we add this to a project, stand alone? atleast, what you have so far.

              Edit: Checked your other thread and I understand you'll be releasign an alpha once the configurations are set, godspeed my friend.

              While I wouldn't mind testing it without this, just for a play around, I'd hate to take time out of your schedule to have you upload it when it isn't ready.
              Last edited by Yoyomike; 08-03-2016, 10:53 PM.


                I wanna use the Ocean in my Project! its Really GReat Awesome Work!, But how i Replace the Character with mine? Delete and Replace Reference is not Working./ Should i Copy and Paste a


                  came the version 4.13 of unreal engine


                    Hi guys great work again, I never heard back on my original questions but I created this WIP video a few weeks ago, its made more progress since this point but I figured you might want to see someone using the Ocean Plugin work. I am having trouble cooking / compiling in 4.12.5, just with a default FPS project and if I remove it it does work fine. This is the link to video and the error message.

                    I tried having the plug in the project directory only, also in the engine directory only, and both now I am moving the source around the see if I can get it work that way.

                    Video Project Tropic: WIP

                    Error message after it starts to run:

                    Plugin 'OceanPlugin' failed to load because module 'OceanPlugin' could not be found. Please ensure the plugin is properly installed, otherwise consider disabling it the plugin for this project.

                    Now we know it works in the editor and I have been using it for a few weeks now, but this happens when I try to compile the project using development build, and it gets about 75% ready to run before the error.

                    I tried reinstalled Visual Studio, only way I can get it to work is to remove the Ocean plugin from the directory, when I run the level it still works but no ocean is visible.

                    Couple of the warnings:

                    ProjectTropic: LogInitisplay: RandInit(-2083562135) SRandInit(-2083562133).LogModuleManager:Warning: ModuleManager: Module 'OceanPlugin' not found - its StaticallyLinkedModuleInitializers function is null.
                    ProjectTropic: [2016.08.05-07.22.10:916][ 0]LogModuleManager:Warning: ModuleManager: Module 'OceanPlugin' not found - its StaticallyLinkedModuleInitializers function is null.

                    Add++ I renamed the Ocean Ent in my level to vex_ocean is that going to create this trouble like I said before it all works fine in the editor just when I try to cook / compile / pak it do the errors happen.

                    Add+++ I forgot to mention I am getting tired that I am doing this through the frontend launcher when it fails. The code does compile in the editor, and does seem to update the Ocean.dll.

                    Add++++ So to get this fixed i had to run the process through VS2015, clean and rebuild everything, then it worked through the Project Launcher. I built shipping and dev no editor, etc all worked. The only thing the Project Launcher did was cook a few assets that had changed.

                    My comments on the project as a non engineer:

                    1) its a very cool free plugin.

                    2) it will only work at this point on Windows, but with the new version of Unreal 4.13 coming with more support for AMD and Mac I am sure this will be update to work with it which will help me since some of my devs are on Macs.

                    3) Separate the Time of Day and Ocean into 2 separate projects on githib, and have one combo branch for people that want both. I had no interest in time of day changing since I saw what it was like on the early versions of QuakeWars when I was working on that product. The game has to be built around and designed around that concept and if it is great but most games dont need it, I could create 3 post setups with different lighting on the same level and get every time of day I feel is worth having a player play.

                    4) You guys have made deployment harder by including all the great samples, I love the samples and used them to learn how you setup your tests so I could apply it to my project but when it came time to I had to go through and remove every asset manually to speed up my cooking time and reduce my overall memory footprint. I would make it clearer which items are the critical components for each part ocean / time of day and which are the extras I did this through trial and error and removed all the time of day I had already mod'd the default skybox to fit the needs of my project, for instance in the movie you can see I have a big sun and the over rides didnt work to do that I had to into BP to scale it from the original source.

                    My perfect setup would be to strip out all the models, textures, materials not required for the base ocean, stack the time of day on top base only no content, then the full kit with all the samples for both would be my perfect setup, seems like you are going in that direction.

                    5) Next time you are doing a large pass clean up and get rid of all old stuff that isnt required anymore, some of the those assets are land mines that cause people to have troubles.

                    Feature Requests:

                    Wet Sand - Allow the user to set a sand color and add a wetness values and drying values based in the (full system) time of day (how hot is the sun? how fast is the sand drying after the waves hit shore?) This would have made me want to use the Time of Day feature.
                    Last edited by Vexar; 08-06-2016, 08:30 PM.
                    Victor "Vexar" Mercieca
                    Twitch Channel
                    Youtube Channel


                      Any updates on the fluid surface? [MENTION=1127]TK-Master[/MENTION]?
                      Last edited by Yoyomike; 08-08-2016, 12:38 AM.


                        Originally posted by Yoyomike View Post
                        Any updates on the fluid surface? [MENTION=1127]TK-Master[/MENTION]?
                        Progress is been made on the GPU implementation.
                        I'm currently out of town for vacation.. I can still work on my laptop but progress will most likely be slow for the next few weeks

                        In the meantime, here's an (early wip) screen of a new water shader I'm working on, using a custom lighting model.

                        4.10 Update! -> [Community Project] WIP Weather & Ocean Water Shader
                        WIP Interactive Water Shader, WIP 2D Water Sim
                        WIP FFT Ocean w/ Foam, Quad-tree Infinite Ocean LOD


                          great job this is awesom but just one question could you plz upload just the shader thats because i dont want the buyoncy and all that other stuff i only need the material because it will not be a playable area and that a very good material and that i have a very slow internet i couldn't download all the project (50 h ??)
                          i need only the material


                            This is a really great project. I am having an issue on my end, though. When I start playing the game, the resolution takes a major nose dive. Everything is incredibly aliased. What setting do I have that I need to change in order to fix this?


                              I seem to be having problems migrating the contents of the project to my own project as on .12.5.

                              Even the included maps fail to have the ocean plane present.

                              Any ideas?

                              Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	23.0 KB
ID:	1113395
                              Click image for larger version

Name:	Capture2.PNG
Views:	1
Size:	21.8 KB
ID:	1113396
                              Click image for larger version

Name:	Capture3.PNG
Views:	1
Size:	23.2 KB
ID:	1113397


                                Quote Originally Posted by kickassitus View Post
                                Hey guys, absolutely amazing work so far!

                                Running into this error when source building UE4 with the ocean plugin, any help at all would be appreciated!

                                1>------ Build started: Project: UE4, Configuration: Development_Editor x64 ------
                                1> Building UnrealHeaderTool...
                                1> Target is up to date.
                                1> Parsing headers for UE4Editor
                                1> C:/Users/*****/Documents/UnrealEngine-release/Engine/Plugins/Ocean/OceanPlugin/Source/OceanPlugin/Classes/OceanManager.h(18) : Property is exposed to the editor or blueprints but has no Category specified.
                                1>Error : Failed to generate code for UE4Editor - error code: -1073741819 (-1073741819)
                                1> UnrealHeaderTool failed for target 'UE4Editor' (platform: Win64, module info: C:\Users\*****\Documents\UnrealEngine-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\UnrealHeaderTool.manifest).
                                1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat UE4Editor Win64 Development" exited with code -1.
                                ========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
                                Hey there,

                                Which version of UE4 are you using, and which branch did you download from the GitHub page? I checked the code, line 18 is the declaration of a struct which doesn't use categories so I'm a little bit confused...

                                If you downloaded the Master branch, try switching to TK's branch (or if you downloaded TK's branch, try downloading the Master) to see if that helps. Let me know if it won't work though!
                                Having the same issue, we're on 4.12.5, and am using 4.12 from here:
                                I copied the OceanPlugin folder to Engine\Plugins\, and then activated the plugin in our uproject file:
                                  "Name": "OceanPlugin",
                                  "Enabled": true
                                If anyone has a work around please post it, working on it myself now. Might be some sort of bug in 4.12 as detailed here:

                                Edit: Solution was to put it in my games plugin folder, rather than the engine one. <your game>/Plugins
                                The UHT auto generates a category based on the file name everywhere but the engine code, for whatever reason, including plugins.
                                Last edited by Stefan3iii; 08-08-2016, 05:39 PM.