No announcement yet.

[Community Project] WIP Weather & Ocean Water Shader

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

    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.


                              [MENTION=1127]TK-Master[/MENTION] , that's good to hear, and enjoy your vacation. If you intend on doing future projects, maybe a development road-map would be a neat option? Because we can follow your progress, and a lot of us are very eager to get our hands on the interactive surface.


                                I have it working in 4.12.5 for both people looking for it and it compiles and deploys, cooks etc. After going through 40 pages of on this thread and searching I found that they say to place the plug in the project directory not the engine directory, I tried both but ended up having be in the project directory was the only way to get it compile and cook even though it did work in engine directory up to that point just fine. My process for getting this to work was to start one step at time, like all black box code from outside sources.

                                First test is to make it works at all.

                                Find and open up the example project from the ocean directory with out anything being touched. If this works you know that your hardware is fine and you have all the content you need, if this isn't working then adding it a project isn't going to help you something is missing most likely hardware related.

                                Step two, test it on an example project from Epic, follow the directions they provide copy what you need, and make sure you can do that. This way if you are not breaking your working project and you can keep it clean.

                                What I did at this point was try an learn how it worked from a content level, how to place a new object or the boat with out using the examples, looked at all the shaders, studied the time of day, and then decided I didnt want it. learned how to remove it with out breaking anything else which was easy just wanted to make sure they were not tied together in some complex way that force me to use the ToD feature.

                                Once you pass this step, remove it from the engine side, copy just what you need over to your project you will find that it does contain out of date content that seems to have no purpose as they are little sloppy to clean it up. Just avoid using options where the shader is blank like anything with the label "old" etc. You will also find it has things related to the boat mp game, and UI, for me I just wanted the ocean so spending the time figure out how to avoid taking it all was worth it for me.

                                One thing to note is if you turn on the shader profiler once you get it running, it is very expensive on the rendering side, it will be the most expensive item in your scene even if you lower it down the lowest (fewest features) settings.

                                For a free plug in though its very pretty.
                                Last edited by Vexar; 08-09-2016, 05:43 PM.
                                Victor "Vexar" Mercieca
                                Twitch Channel
                                Youtube Channel