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

    First of all thanks for doing this great project and sharing it.
    secondly I wanted to share a possible bug I have found. if you adjust the camera somewhere exactly around the surface of the water, somewhere between the waves a half sphere appears
    here is a screen shot i got from one of the maps in your project without touching anything in it
    Click image for larger version

Name:	bug.jpg
Views:	1
Size:	372.5 KB
ID:	1131259
    Attached Files

    Comment


      Originally posted by jonathan light
      Here is a demonstration
      Going to test this soon. Thanks Jonathan!

      Only thing missing are beach waves .... THe market pack Beach Water uses a spline, which needs to be setup around the island shore.
      LEGENDS OF EPICA | CS - SPACE ALPHA

      Comment


        Anyone know how to set the Terrain Material Instance Parent at run-time in C++?

        Comment


          Originally posted by WixZ View Post
          The TrueSky node is actually doing exactly what it should and the problem it caused on your water is in fact fully fixed. The smaller holes you are seeing are caused by the fact that Unreal engine is a deferred renderer which has serious issues with rendering layered transparency. There is a "workaround" to "fix" this though but it comes at a cost. A cost of having to render your ocean twice, meaning you will need to place your ocean mesh inside your level at the exact same coordinates twice. One has your normal ocean shader he other will act as a depth buffer rendered at a seperate depth channel which you then have to call from your main ocean shader and use as a mask to hide the backside of each wave. This also means that he back of each wave will also be fully opaque, but there is yet another fix for that if you use custom refraction by utilizing your scene color which does allow you to create fully transparent water material with no sorting issues but if you want to know more about that just ask.

          These are the nodes you will need in your main shader: (Note I did not come up with this fix, It was provided by someone on the forums and is also included in the community ocean project)
          [ATTACH=CONFIG]147217[/ATTACH]

          Custom node:
          [ATTACH=CONFIG]147219[/ATTACH]

          Then you'll want to make a depth buffer material to apply on your second mesh. Inside this material should be your wave displacement and pretty much nothing more. Might want to tweak some settings to make it as lightweight as possible as all this material needs to do is render to a custom depth pass, nothing more. Then apply this material to your second waterplane mesh and make sure the waterplane mesh is set to render to custom depth pass:
          [ATTACH=CONFIG]147218[/ATTACH]

          That's it. The sorting issues will be gone, but your water just got twice as expensive to render.

          There are probably better ways to deal with this issue but I have no idea how. Well I guess you could switch to forward rendering, but that has other issues and limitations that don't weigh up against the pros of defered rendering. If anyone knows of some other fix for this sorting issue, feel free to correct me.
          sorry for the big quote

          I'm looking to combine the TrueSky plugin with this ocean.
          Results thusfar are that the ocean is sort of black.
          Could you maybe explain (in a sort of noob ue4 language) how I can set this up?
          ]Click image for larger version

Name:	ue4help.jpg
Views:	1
Size:	419.3 KB
ID:	1131286

          would be a great help

          Comment


            Originally posted by jonathan light
            ...
            Is there a ready plugin version available yet for 4.16? Are these palm tree, the coastal erosion, the sk, and the landscape material features part of the update?
            LEGENDS OF EPICA | CS - SPACE ALPHA

            Comment


              Originally posted by unit23 View Post
              Is there a ready plugin version available yet for 4.16? Are these palm tree, the coastal erosion, the sk, and the landscape material features part of the update?
              Hello, my pleasure, all these integrations were made by me.

              Comment


                Hello mates
                Two days ago I just started to read this project and I want to understand algorythm, because I want to write simple water in c++, but i don't know few things...
                1) Why there are 2 sets of waves
                2) Why there are 8 waves in set
                I really don't know this
                And maybe someone know any articles with water physics/shaders theory?

                Comment


                  I don't know if I missed something, but is there a post explaining how to install this plugin? Also, I'm using 4.16, and I can't seem to figure out what exactly to download :/

                  Comment


                    I have faced an issue regarding changing some variables of the plugin.
                    it seems stay-upright and some other configuration is only applied during the initialization round and later won't be taken to consideration.
                    can we expose a function for reinitialization ?

                    Comment


                      hello, i want to create naval simulation.with connection to 2D programing is create from c#. in 2D programming will control our ship in 3D.i need to access lightningActive from c++ programming, but i cannot access that variable. how i can access from my c++ programming? in case that variable, create on blueprint.

                      thanks before. sorry if my speeking english is't good.

                      Comment


                        Originally posted by Thijs Linssen View Post
                        sorry for the big quote

                        I'm looking to combine the TrueSky plugin with this ocean.
                        Results thusfar are that the ocean is sort of black.
                        Could you maybe explain (in a sort of noob ue4 language) how I can set this up?
                        ]

                        would be a great help
                        Hi Thijs. Our team spent a few months working with truesky and eventually abandoned it in favor of another option. The ocean incompatibility was one of many reasons but unless truesky has had some major changes I don't see the integration being anything less than a major undertaking.

                        Comment


                          Originally posted by OptionalSteve View Post
                          [MENTION=53616]Jackseno[/MENTION] [MENTION=464666]finwefeanor[/MENTION]

                          The buoyant mesh component included in the project works way better for smaller boats (and even bigger ones IMO) than the test points buoyancy. It uses a completely different type of logic for buoyancy and is more physically accurate. Here's where it's first introduced (ignore the part about the separate OceanProject version, it's since been included in the project).

                          As far as solving the ocean clipping issue, I've been using a combination of the ocean surface mask (that you can see in one of the demo levels) and the "mesh lens" technique I described earlier. Both solutions have their problems and I'm working on a more perfect solution, I'll post here when it's finished.
                          I'm glad you like it I think you are talking about the currently functioning one? We both started from the same article but I overcame some of the more subtle hurdles to make a stable simulation. I also made sure there were no nvidia includes necessary. It also takes advantage of the LOD system so you can use a fancy LOD for the visuals and the lowest LOD for the buoyancy simulation to make sure your game runs fast. I also read data from the video card so you don't need to hold all the mesh information in RAM with the CPU access option . It still could use some improvements but it's a great start.

                          I made it for Fishing: Barents Sea.

                          Comment


                            Originally posted by Burnrate View Post
                            I'm glad you like it I think you are talking about the currently functioning one? We both started from the same article but I overcame some of the more subtle hurdles to make a stable simulation. I also made sure there were no nvidia includes necessary. It also takes advantage of the LOD system so you can use a fancy LOD for the visuals and the lowest LOD for the buoyancy simulation to make sure your game runs fast. I also read data from the video card so you don't need to hold all the mesh information in RAM with the CPU access option . It still could use some improvements but it's a great start.

                            I made it for Fishing: Barents Sea.
                            Yes I do mean the currently functioning one and I really appreciate you working on it for the project! The test points buoyancy works well for small things, like barrels, but really I think the buoyancy mesh works way better for anything with a complicated shape. Great looking game by the way.

                            Out of curiosity, has your team found a solution for the ocean clipping problem?

                            Comment


                              Actually I just found the solution to the ocean clipping problem, courtesy of [MENTION=185685]WixZ[/MENTION] on his (awesome) game's thread here.

                              It's really as easy as he describes, and his post has all the details about how this works, but I'll post my steps and blueprint in case anyone needs to find it in this thread for whatever reason.

                              First enable "Generate Mesh Distance Fields" in your project settings.

                              In your ocean material (whichever one you're using, in my case it's M_Ocean_Ultra), create the distance field mask:

                              Click image for larger version

Name:	Pic2.png
Views:	1
Size:	51.2 KB
ID:	1131645

                              And then plug the result of the multiply node here into the B value of the lerp in your mask.

                              Click image for larger version

Name:	Pic1.png
Views:	1
Size:	174.5 KB
ID:	1131644

                              Then plug the result of the lerp into the opacity node of your ocean material.

                              And that's basically it. Here's it working inside of a giant rectangle:

                              Click image for larger version

Name:	Pic3.png
Views:	1
Size:	786.8 KB
ID:	1131646

                              The only serious limitation I've found is that the object you use to cull the ocean must have shadows enabled, no idea why

                              Again thanks to [MENTION=185685]WixZ[/MENTION] for this solution it's a huge help. [MENTION=464666]finwefeanor[/MENTION] I know you asked for something like this earlier, so I'm tagging you so you get the alert.

                              Comment


                                Hi All,

                                I am trying to add a boat with buoyancy along with controls. I am able to achieve them. I checked the options Use Controller Yaw, Pitch, Roll as the result I can move rotate the ship but I did not like physics as boat is not reacting to waves. If I uncheck them (Use Controller Yaw, Pitch, Roll) the boat will eventually sink in direction I am moving. I am pretty new to this. Can anyone help me to set movement along with proper buoyancy please..

                                PFA:

                                Click image for larger version

Name:	Ship_movement.PNG
Views:	1
Size:	157.8 KB
ID:	1131647

                                Comment

                                Working...
                                X