Announcement

Collapse
No announcement yet.

[Community Project] WIP Weather & Ocean Water Shader

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

    Originally posted by TK-Master View Post
    I just implemented the landscape modulation part in the ocean manager so that the buoyancy matches but the performance hit is huge .. I'm currently using a single ray trace per point to

    Yup it looks even better now with animated wet lens effect:

    I have also modified a couple .usf files so that GaussianDOF works with the ocean plane properly.
    That looks very sexy , nice work!
    \\VANGUARD INTERACTIVE

    Marketplace - Action RPG Inventory System | Multiplayer TopDown Kit | Advanced Social System
    Multiplayer TopDown Kit Tutorials - Merging The Action RPG Inventory System | Removing the Fog of War
    Action RPG Inventory Tutorials - Merging Into Your Project | Adding New Items | FPS Controls w/ UI Mode Toggle

    Comment


      Originally posted by NCMcClure View Post
      How did you go about creating this half-in-half-out water effect? That's not implemented in the GitHub project files is it? I've been trying to do this exact effect for my current Oculus Rift project but I can't figure it out for the life of me. I've just been using a post-process effect, which obviously doesn't give the desired effect when there's relatively large waves. Some guidance on this would be much appreciated.
      The GitHub project does have this. Not the water on the camera, but the darkening of the screen and audio dampening when you are under water, and taking into account the waves. I don't know how it's done, but it's there to analyze in the project.

      Comment


        Originally posted by TK-Master View Post
        I just implemented the landscape modulation part in the ocean manager so that the buoyancy matches but the performance hit is huge .. I'm currently using a single ray trace per point to detect the landscape height but for some reason it costs way more than I thought.. it could be an issue with landscapes in general or tracing is simply that expensive(?) I don't know.

        There is one last thing that I can try.. read the heightmap pixels rather than tracing, I could load the pixels into a float array on begin play which should hopefully be a lot faster to access but the downside is that I will have to replicate the same math as the heightmap modulation material function (I was hoping to completely avoid that by tracing).
        Alright so I finally finished implementing and testing the heightmap pixel reading method and it has no performance impact, it might cause a tiny delay on begin play if the heightmap texture to load is large but it's barely measurable.

        The calculated landscape height from the heightmap is not as accurate as the trace since a single pixel corresponds to 4 vertices (at least that's what I think), so if we need a more accurate result for some reason we could use bicubic interpolation or something like that but it's really not needed for the heightmap modulation, it makes no difference.

        I also added a small optimization to skip the gerstner calculations if a test point is too far below or above the base sea level, I might also add a bounds check to the buoyancy component to skip all buoyancy point iterations if the mesh is completely out of the water.
        Not that any of that is important the buoyancy stuff already have no performance hit really.

        Also added a harpoon gun that I quickly prototyped a few months ago it uses a physics constraint for the rope physics and cable component for the visuals and let me tell you it was so much fun making this thing ships glitching, objects flying to space and whatnot .. love messing around with these kind of stuff.


        There are a few more things I need to fix before the release so bear with me just a little longer

        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

        Comment


          Alright, i think i have to give this plugin a go.

          A few questions, is there a working 4.10.4 binary ready?
          Is this plugin viable for huge tiles, how much fps drop can i expect with reasonable medium settings? Basically i just want standard water, and waves ...
          [LEGENDS of EPICA][Twitter][FB][YT][Vimeo][Reallusion Technical Expert]

          Comment


            I want the boat to move a little forward when the 2 front buoyancy test points are lower than the back 2. Like surfing on a wave. Testpoints don't change in game so how to do alike?
            Thanks

            Comment


              [MENTION=1127]TK-Master[/MENTION] - So I looked at some pictures and also how Dying Light does the fade when the camera is half-submerged. Basically, it's a thick black gradient on the submerged side of the hard line (both IRL pictures and the Dying Light method), with a little bit on the top.

              I'm thinking you could do a secondary gradient towards the very top of the surface for the underwater fog post effect in order to get this, but I'm not sure how to achieve it :P Basically it needs to go from 0 opacity at 90-something % to the top of the volume to 100 at the very top.
              Storyteller - An immersive VR audiobook player

              Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

              Comment


                TK is that wet lens effect done all with materials? My current go uses blur on a simple texure that slides off the screen and it lookos well... cheesy.
                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

                Comment


                  Looking beautiful!!!

                  I see that only x64 binaries are on github. Do you plan on providing 32bit binaries too?

                  Is it Linux/Mac compatible ? (I figured it would have to be compiled for those platforms)

                  Does it support physics? (floating stuff and move it with the surface)

                  Comment


                    Originally posted by OptionalSteve
                    Is it possible the deform the ocean mesh locally or in an arbitrary location? I'd like to simulate immersion displacement, briefly talked about in this article. You can see it working in these screen shots from Assassin's Creed Black Flag, it looks like it deforms the water mesh where it would overlap with the ship at the surface.

                    Immersion displacement will add a bit of realism, simulating how shisps cut through waves and displace water. It also removes the need to mask out the part of the ocean mesh that clips through a ship's hull at the surface. However, I know AC uses FTT waves and doesn't actually render anything under the waves. So is this possible with Ocean Project and will it look weird when viewed from below the surface?
                    Once I get to the skill levels of some of the members here I will be doing all sorts of things with displacement for my game. Right now im working on getting my C++ skills up with InfinteSkills 3 C++ video courses and Bjarne S.'s books and then gonna start learning the UE4 API and I'll be doing some stuff like bow waves, kelvin wakes, splashes, currents, water temperature etc. etc. etc.

                    My timeframe is the same as TK's/DC's though... when we get around to it.

                    In the meantime become an expert in particle systems, itll help you get placeholder effects for now and will help you create optomizations later.
                    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

                    Comment



                      Soon(TM)..



                      ---------------------
                      Reply train ahead.......


                      Originally posted by n00854180t View Post
                      [MENTION=1127]TK-Master[/MENTION] - So I looked at some pictures and also how Dying Light does the fade when the camera is half-submerged. Basically, it's a thick black gradient on the submerged side of the hard line (both IRL pictures and the Dying Light method), with a little bit on the top.

                      I'm thinking you could do a secondary gradient towards the very top of the surface for the underwater fog post effect in order to get this, but I'm not sure how to achieve it :P Basically it needs to go from 0 opacity at 90-something % to the top of the volume to 100 at the very top.
                      The problem is the positioning of the line, not the gradient.
                      I have not found a (cheap) way to match it exactly where the ocean plane clips the camera.

                      Dying Light uses a flat water plane from what I have seen which is really easy to calculate and mask (how convenient for them ) just a straight line.
                      I might make a flat plane version sometime if there is enough interest.

                      Originally posted by Nsomnia View Post
                      TK is that wet lens effect done all with materials? My current go uses blur on a simple texure that slides off the screen and it lookos well... cheesy.
                      Ya it's nothing special.. just a panning normal map with distorted uvs.
                      (It will be included in the update ofc.)

                      Originally posted by OptionalSteve
                      Is it possible the deform the ocean mesh locally or in an arbitrary location? I'd like to simulate immersion displacement, briefly talked about in this article. You can see it working in these screen shots from Assassin's Creed Black Flag, it looks like it deforms the water mesh where it would overlap with the ship at the surface.

                      Immersion displacement will add a bit of realism, simulating how ships cut through waves and displace water. It also removes the need to mask out the part of the ocean mesh that clips through a ship's hull at the surface. However, I know AC uses FTT waves and doesn't actually render anything under the waves. So is this possible with Ocean Project and will it look weird when viewed from below the surface?
                      Anything is possible but something like this will not be easy to implement.
                      The article does not have any details about their implementation but essentially it's like the fluid surface plugin (which its code is a bit too complicated for me at this point in time).

                      It might be a lot easier to use a projected texture mask with the shape of the hull to displace the ocean but that can not work for more than a ship or two at the same time and you won't be able to generate kelvin wakes or anything like that that way.

                      Originally posted by NCMcClure View Post
                      How did you go about creating this half-in-half-out water effect? That's not implemented in the GitHub project files is it? I've been trying to do this exact effect for my current Oculus Rift project but I can't figure it out for the life of me. I've just been using a post-process effect, which obviously doesn't give the desired effect when there's relatively large waves. Some guidance on this would be much appreciated.
                      I used the stencil buffer to do the half-in-half-out masking (mentioned a couple pages back) will be included in the upcoming update.

                      Originally posted by unit23 View Post
                      Alright, i think i have to give this plugin a go.

                      A few questions, is there a working 4.10.4 binary ready?
                      Is this plugin viable for huge tiles, how much fps drop can i expect with reasonable medium settings? Basically i just want standard water, and waves ...
                      The upcoming update will be compiled for 4.10.4.
                      The ocean plane follows the camera which make it appear as infinite so there are no tile limits.

                      All things considered, the performance in the project is really good.. it's not a heavy project like the kite demo or anything
                      You could say it's optimized for mid-range cards since I'm currently using a gtx 690 (which is like a 680 since UE4 doesn't support SLI) so I'm trying to keep the performance at 60 fps for my card which probably translates to over twice the fps for the lucky 980 owners.

                      Originally posted by motorsep View Post
                      I see that only x64 binaries are on github. Do you plan on providing 32bit binaries too?

                      Is it Linux/Mac compatible ? (I figured it would have to be compiled for those platforms)
                      Sorry, I will only be providing 64bit windows binaries but it shouldn't be an issue to compile for linux/mac.
                      However the shader is not currently compatible with opengl due to the 16 texture limitation (also no tessellation).
                      I am working on a "Lite" version of the shader though which should be compatible, not sure if that will make it to the upcoming update though.

                      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

                      Comment


                        Yeah, actually finding the correct line position is the part I'm not sure how to achieve, XD, that wasn't clear. Or at least, not cheaply.
                        Storyteller - An immersive VR audiobook player

                        Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

                        Comment


                          Wow with clouds and rain. Looking forward to this update. Not sure if the Linux/Mac stuff still makes much sense, thinking about the soon to arrive Vulkan support. Ships moving with wind and/or waves, also breaking waves and I'd be in heaven.

                          Comment


                            hello guys, I follow your project for months, and in addition to renew my congratulations, I have a question, others will come out short updates?

                            Greetings

                            Comment


                              TK-Master,

                              Can you give us a quick list of what will be included in the next update?

                              I am hoping some of the items on my short list will be fixed in the next release:

                              1. The caustics should be visible when standing near shallow water, not just when under water. If I remove caustics from the Set Underwater Mode and put it in the PP Underwater volume blendables will that fix it?

                              2. Need an integration of Ultra Dynamic Sky with this shader. The developer will not respond to e-mail. In the level BP, Set Underwater Mode, when using Ultra, the Ocean Wave Cue new volume will work, but the caustics and Set Intensity and Set Light Color do not, even when replacing the BP_Sky target intensity and color with an Ultra float and Linear Color to provide a new Sky Light Component. Also, tried plugging in the "Update sun's rotation material parameter (SSS) into the "Ultra BP Set Material Variables", can't get that to work either.

                              3. Or, add "Ultra like" clouds and shadows to the Skydome_BP.

                              3. Swim and tread water animations

                              4. Character buoyancy when breaking the water surface plain, so it bobs with the waves while treading or swimming.

                              5. Water Line

                              6. Landscape Height modulation so I can stop waves encroaching on shoreline, and add my own swash, backwash, and wet sand function

                              7. Light rays integrated with the caustics during daylight hours.

                              8. A blocking volume function so underwater assets "stay dry."

                              9. Function changing water color based on Z depth, like Black Flag.

                              Thanks for all your hard work. I understand, it is a spare time thing for you ... I would gladly donate to speed things up or to get you to work on these issues ... if people in the community like you do not work on this it will not get done.

                              I don't think EPIC gets it. Water is a big deal today. Even Unity and Blender are way ahead of us. UE4 is the only engine without it. I don't need an engine that support a hundred square mile level, or better looking hair for our 1st person character, or planar reflections on only Samsung mobile apps. Maybe someone at the top of EPIC needs a baptism to understand our need for good water.

                              This article explains the systemic problems with UE4 in a very supportive way:
                              http://gamasutra.com/blogs/LeszekGod...rammerquot.php

                              One of the most beautiful games of all time, The Vanishing of Ethan Carter, was developed on UE3. But to port it over to UE4 and Playstation 4 required their 8 person team to include a full time engine programmer to fix UE4 issues. In the article they talk about the same issues you face with this ocean shader, which are systemic to EPIC's engine roadmap for UE4:

                              1. "the way screen-space reflections are culled on the sides of the screen in a trapezoid shape"

                              2. "depth-unaware blending of reflection cubemaps"

                              3. "translucent mesh rendering ... scene colour texture resolve is done per mesh element, not per entire mesh"

                              4. "lightmaps are meant to contain indirect (bounced) lighting only ... they don't have specular highlights"

                              The "workarounds" in this ocean shader are great, but they create a form of spaghetti code that is not easy to work with and is just one engine upgrade away from not working.

                              Still, no pressure TK, but this project is our only hope for realistic water.

                              Comment


                                Originally posted by CrashA51 View Post
                                TK-Master,

                                Can you give us a quick list of what will be included in the next update?

                                I am hoping some of the items on my short list will be fixed in the next release:

                                1. The caustics should be visible when standing near shallow water, not just when under water. If I remove caustics from the Set Underwater Mode and put it in the PP Underwater volume blendables will that fix it?

                                2. Need an integration of Ultra Dynamic Sky with this shader. The developer will not respond to e-mail. In the level BP, Set Underwater Mode, when using Ultra, the Ocean Wave Cue new volume will work, but the caustics and Set Intensity and Set Light Color do not, even when replacing the BP_Sky target intensity and color with an Ultra float and Linear Color to provide a new Sky Light Component. Also, tried plugging in the "Update sun's rotation material parameter (SSS) into the "Ultra BP Set Material Variables", can't get that to work either.

                                3. Or, add "Ultra like" clouds and shadows to the Skydome_BP.

                                3. Swim and tread water animations

                                4. Character buoyancy when breaking the water surface plain, so it bobs with the waves while treading or swimming.

                                5. Water Line

                                6. Landscape Height modulation so I can stop waves encroaching on shoreline, and add my own swash, backwash, and wet sand function

                                7. Light rays integrated with the caustics during daylight hours.

                                8. A blocking volume function so underwater assets "stay dry."

                                9. Function changing water color based on Z depth, like Black Flag.

                                Thanks for all your hard work. I understand, it is a spare time thing for you ... I would gladly donate to speed things up or to get you to work on these issues ... if people in the community like you do not work on this it will not get done.

                                I don't think EPIC gets it. Water is a big deal today. Even Unity and Blender are way ahead of us. UE4 is the only engine without it. I don't need an engine that support a hundred square mile level, or better looking hair for our 1st person character, or planar reflections on only Samsung mobile apps. Maybe someone at the top of EPIC needs a baptism to understand our need for good water.

                                This article explains the systemic problems with UE4 in a very supportive way:
                                http://gamasutra.com/blogs/LeszekGod...rammerquot.php

                                One of the most beautiful games of all time, The Vanishing of Ethan Carter, was developed on UE3. But to port it over to UE4 and Playstation 4 required their 8 person team to include a full time engine programmer to fix UE4 issues. In the article they talk about the same issues you face with this ocean shader, which are systemic to EPIC's engine roadmap for UE4:

                                1. "the way screen-space reflections are culled on the sides of the screen in a trapezoid shape"

                                2. "depth-unaware blending of reflection cubemaps"

                                3. "translucent mesh rendering ... scene colour texture resolve is done per mesh element, not per entire mesh"

                                4. "lightmaps are meant to contain indirect (bounced) lighting only ... they don't have specular highlights"

                                The "workarounds" in this ocean shader are great, but they create a form of spaghetti code that is not easy to work with and is just one engine upgrade away from not working.

                                Still, no pressure TK, but this project is our only hope for realistic water.
                                A lot of these are still very specific implementations that TBH youll probably never see anytime soon or for free. Even commerical ocean solutions have users do some of these on their own because the implemntations are project specific.
                                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

                                Comment

                                Working...
                                X