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

    #91
    Originally posted by Nesjett View Post
    Great to hear this DotCam, but I have a suggestion for you, I think you should release separated demo projects, one for the water like now, and other where you will add the swim capabilities.

    I say this because its probable that some people doesnt want to have a swimable water

    Just a suggestion!
    Thanks for pointing this out, I meant to explain this a bit better. I am actually planning to add in multiple BP Wave Controllers each with a optional components, such as:

    - The original version for those who need an ocean in the distance and really don't care for anything else
    - The original version + Underwater Effects
    - The original version + Buoyancy
    - The original version + Buoyancy + UnderWater effects.

    On top of all of that, I will be adding in a 8 wave solution for all of the above, along with the 16 wave version for all above. 8 wave Sets is really all you need for the open ocean, and saves a lot of processing. Also the Original Version mentioned has had some other updates, more on that soon.

    I have been planning this for a bit now, the use cases for something like this are so different that creating a single monolithic blueprint is not feasible, so there will be a few to choose from.


    Originally posted by Ardivaba View Post
    Any progress with that update?
    There has been progress, but it has only been a day...

    I will have this out to you guys early this coming week!
    Last edited by DotCam; 01-10-2015, 10:56 PM.
    Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

    Comment


      #92
      Originally posted by DotCam View Post
      Hey there, sorry for the delay, had a huge ice storm knock out power for 2 days.

      It is hard to tell from the images what is causing that look, if you could zip up a copy of the project and upload it to DropBox or other similar site and then PM me the link I will certainly take a look for you! Or if you could PM me some more images showing the Gerstner formula & Cluster I can try and figure it out for you. It's most likely an issue with the Gerstner formula itself, or the values you have set for the WaveLength/Amplitude/Steepness values in the Gerstner Cluster.
      I really appreciate that you're willing to help. Here's the link to my project: https://www.dropbox.com/s/fiuhrzxfvi....uproject?dl=0 Thanks for the help, and great job on the buoyancy!

      Comment


        #93
        Found out that it had the kinda underwater effect I was looking for Amazing work so far DotCam.

        Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	179.0 KB
ID:	1065066
        System
        ASUS ROG Maximus IX Forumla - ASUS ROG GeForce GTX 1080 8GB - G.Skill RGB 16GB, Samsung M2 500GB

        ArtStation
        Artwork thread

        Comment


          #94
          Originally posted by Frequia View Post
          Found out that it had the kinda underwater effect I was looking for Amazing work so far DotCam.
          It does render the ocean on each side of the mesh, but it does not have the PostProcess effects for underwater in that version, it should look like you are underwater from that view (ie have a blurred depth of field that gets stronger for farther away objects, along with color grading & a blueish color to make it look like water). Sort of like this (this is an old image, it has been modified since this image was captured):

          Click image for larger version

Name:	underwater.PNG
Views:	2
Size:	760.4 KB
ID:	1065068


          Hmmm... I have a question for you though, your ocean appears to not have any specularity/reflections at all. Did you change your settings to make it look that way or is t not working correctly? Here is an image showing what it looks like by default:
          Click image for larger version

Name:	0before.PNG
Views:	2
Size:	932.9 KB
ID:	1065067


          You do need to have a movable SkyLight in your scene to enable that look, but if that is how you want it to look then it's no problem, just curious.
          Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

          Comment


            #95
            Yes, I changed the settings to make it look like that and its working just fine Im going for a toonish-water look, so I dont need so much advanced postprocessing.
            System
            ASUS ROG Maximus IX Forumla - ASUS ROG GeForce GTX 1080 8GB - G.Skill RGB 16GB, Samsung M2 500GB

            ArtStation
            Artwork thread

            Comment


              #96
              Originally posted by DotCam View Post
              IT WORKS! I just got Buoyancy working!!! Woohoo!!!

              I need to do a bit more polishing and test it out with a few different objects with different shapes, but it actually works! Man I am so happy right now. I will try to model a simple boat and some other shapes for you guys to play around with.

              Expect a new release WITH buoyancy in a couple of days!

              Thank you so much Handkor in case you read this, I had to brush up on my C++ skills for a couple of weeks and learn the API (and coding conventions), but I finally figured it all out. Your BuoyancyComponent works great! I plan on modifying it a bit to automatically detect the shape of the object for the test points, with adjustable COM and weight of the object to increase or decrease the displacement of the object (for example the draft on a ship).

              And thank you everyone for your patience on this, sorry it has taken so long... I'm finally able to work on this again so stay tuned!
              Yes this is something I wanted to add in the future too. Let the user enter custom point or lets them choose from a set of predefined hulls (Cube, sphere, cylindre, boat,...) where the user can just choose point density.

              Comment


                #97
                Originally posted by DotCam View Post
                IT WORKS! I just got Buoyancy working!!! Woohoo!!!

                Expect a new release WITH buoyancy in a couple of days!

                stay tuned!
                Really awesome cannot wait for this!

                Is it possible to get it looking as good as cryengines dx11 water?

                Or would that be a job for waveworks? Not sure if waveworks will only work on nvidia for a long time I wish your material could look this beautiful

                Last edited by CyberDev; 01-13-2015, 07:57 PM.

                Comment


                  #98
                  Just a quick video update showing the buoyancy is almost working! There are some obvious issues with it, so it's not quite ready for release. Mostly it is a matter of tweaking values to get it operating as expected, so nothing major (I hope!), and I will update you guys again soon.



                  Originally posted by Handkor View Post
                  Yes this is something I wanted to add in the future too. Let the user enter custom point or lets them choose from a set of predefined hulls (Cube, sphere, cylindre, boat,...) where the user can just choose point density.
                  Yeah it would make things so much simpler and is something I will be looking into, but right I have bigger problems to deal with...

                  Did you do anything special inside the graph on the buoy and/or change the values (such as Buoyancy, test point volume radius or directional damping)? As you can see from the video it is acting pretty strange. If I turn off "Simulate Physics" for the Buoy it bobs up and down perfectly with the waves (just no side to side angle rotation). I may have a bug somewhere in the code, will take a look again to see what's up. Thanks for any insight on this!
                  Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                  Comment


                    #99
                    Will the buoyancy work on the blue character as well as custom characters too? Im going to try the system in 4.7.0 preview 3 by the way
                    System
                    ASUS ROG Maximus IX Forumla - ASUS ROG GeForce GTX 1080 8GB - G.Skill RGB 16GB, Samsung M2 500GB

                    ArtStation
                    Artwork thread

                    Comment


                      Originally posted by DotCam View Post
                      Just a quick video update showing the buoyancy is almost working! There are some obvious issues with it, so it's not quite ready for release. Mostly it is a matter of tweaking values to get it operating as expected, so nothing major (I hope!), and I will update you guys again soon.



                      Yeah it would make things so much simpler and is something I will be looking into, but right I have bigger problems to deal with...

                      Did you do anything special inside the graph on the buoy and/or change the values (such as Buoyancy, test point volume radius or directional damping)? As you can see from the video it is acting pretty strange. If I turn off "Simulate Physics" for the Buoy it bobs up and down perfectly with the waves (just no side to side angle rotation). I may have a bug somewhere in the code, will take a look again to see what's up. Thanks for any insight on this!
                      If physics is off I set actor location to the water surface, that is intended behavior to allow none physical object to be able to snap to the water's surface.

                      In the video it almost looks like your damping values are too high along the z-axis. The directional damping is like normal linear damping but it allows an object to have different values along each axis. This was added to let a boat keeps its momentum going forward but have heavy drag going sideways. There might be a bug where the damping is applied even when a point is out of the water though.

                      Buyoancy you can leave to 1.
                      Test point volume is meant to place a sphere around each testpoint so that when a point is near water it offers a percentage buoyancy of it's spherical volume instead of just a black and white over/under water. It allows the force to be applied more gradually as a point crosses the water level.

                      Comment


                        Originally posted by Handkor View Post
                        If physics is off I set actor location to the water surface, that is intended behavior to allow none physical object to be able to snap to the water's surface.

                        In the video it almost looks like your damping values are too high along the z-axis. The directional damping is like normal linear damping but it allows an object to have different values along each axis. This was added to let a boat keeps its momentum going forward but have heavy drag going sideways. There might be a bug where the damping is applied even when a point is out of the water though.
                        Ok that makes sense, I was using the default damping on Z (5), now that I know it was for a boat I will try out some different values. I fixed the majority of the angular rotation issues, and the buoy no longer stops suddenly at a certain level like it did in the video.

                        The performance is getting a bit better, still fairly heavy on the CPU (22ms for the scene in the video, 45fps on a GTX 980 / i5 4670k), just the ocean simulation runs at 120fps without the added CPU calculations, so it is just a tad bit concerning... I intend to try reducing the large waves down to a single cluster of 8 and use those to calculate buoyancy, and use the other cluster for detail waves. The other thing I have been testing is only applying force when the test point is under water, and letting the built in gravity do the rest. I might leave this for now and release an "early adopters" version with the system as is then update again once I get the performance to a reasonable level.

                        Actually I think I just realized what is causing the performance drop... Will post an update later on if I'm right!

                        Buyoancy you can leave to 1.
                        Test point volume is meant to place a sphere around each testpoint so that when a point is near water it offers a percentage buoyancy of it's spherical volume instead of just a black and white over/under water. It allows the force to be applied more gradually as a point crosses the water level.
                        The problem I have currently is setting the buoyancy value to 1 causes the object to sink almost to the bottom, come back up and jump out of the water, then sink back down again. Once it finally settles, it still sinks down too far. Is it possibly the mass of the object is too high? Or should the test point volume be increased to compensate? I'm still trying to find the best solution, other objects work just fine at 1, but to keep the buoy on the surface I have to bump it up to a minimum of 4 currently... :/

                        So it's coming along, getting closer. Thanks again for all your help!
                        Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                        Comment


                          Hey DotCam, I see you did some progress with the buoyancy sweet.

                          Is it possible that you send me your current files? I have a buoyancy system which I made like a gazillion months ago that is just gathering dust in some dark corner of my hard drive, aching for some action lol.

                          My buoyancy system is basically a function that takes in a vector array (with the buoyancy point offsets, I also have an auto-generating system that generates points based on the mesh collision and some parameters but that's another story!), damping variables, a mesh density variable (float) and a water density variable which basically calculates the buoyant force based on the difference in density and depth, the density variable can be super easily adjusted and fine-tuned for different kind of objects, I think it even works for helium balloons if you adjust the density and apply it when out of water

                          Now the main thing that my buoyancy function is missing (other than a lot of polish, some rewriting and perhaps some wave-drag force) is a way to get the wave height from your ocean at each specific array point, seems you already have that part working based on Handkor's work so perhaps we can merge our work or something

                          I'm assuming you feed the parameters from the material instance to the wave height calculations in order to be able to sync the waves dynamically? that's the part that I never got to finish xD

                          I made an attempt to get the height data from WaveWorks with no luck unfortunately.. my C++ skills failed me q_q.. didn't want to try the render target approach as it's super slow.

                          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


                            Originally posted by TK-Master View Post
                            Hey DotCam, I see you did some progress with the buoyancy sweet.

                            Is it possible that you send me your current files? I have a buoyancy system which I made like a gazillion months ago that is just gathering dust in some dark corner of my hard drive, aching for some action lol.

                            My buoyancy system is basically a function that takes in a vector array (with the buoyancy point offsets, I also have an auto-generating system that generates points based on the mesh collision and some parameters but that's another story!), damping variables, a mesh density variable (float) and a water density variable which basically calculates the buoyant force based on the difference in density and depth, the density variable can be super easily adjusted and fine-tuned for different kind of objects, I think it even works for helium balloons if you adjust the density and apply it when out of water

                            Now the main thing that my buoyancy function is missing (other than a lot of polish, some rewriting and perhaps some wave-drag force) is a way to get the wave height from your ocean at each specific array point, seems you already have that part working based on Handkor's work so perhaps we can merge our work or something

                            I'm assuming you feed the parameters from the material instance to the wave height calculations in order to be able to sync the waves dynamically? that's the part that I never got to finish xD

                            I made an attempt to get the height data from WaveWorks with no luck unfortunately.. my C++ skills failed me q_q.. didn't want to try the render target approach as it's super slow.
                            Sorry for the delayed response, I just read this now, but I will package up an "Early Adopters ONLY" project and upload it here in the morning. It will basically be the current download + buoyancy, and some other small tweaks. For all those wondering when the other features will be added, I will release an actual version 2 as soon as possible (as soon as the performance gets better).

                            It would be awesome if you (and any others) can help me test out some solutions to getting better performance. This is the reason for the delay, I really hoped to have it ready a few days ago, but the CPU usage spiked fairly high.

                            It sounds like your system for buoyancy is very similar, so it will be great to possibly merge the two together. Anyways I'll go into more detail tomorrow morning. I will post it in the thread here instead of adding a link to the main page, as this will be more of a beta test than a release.

                            Thanks for offering to help TK! I need some fresh eyes on this, I'm probably doing something very simple very wrong.
                            Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                            Comment


                              "Early Adopters ONLY" sounds good I will start adapting my code as soon as I have the project files.

                              I'm curious though, where is the CPU usage you are talking about coming from? I had tried Handkor's gerstner waves and it runs fairly fast, unless you use many clusters of waves.

                              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


                                Originally posted by TK-Master View Post
                                I'm curious though, where is the CPU usage you are talking about coming from? I had tried Handkor's gerstner waves and it runs fairly fast, unless you use many clusters of waves.
                                EDIT: For anyone reading this now, the following 2 paragraphs outlining how the OceanManager works was not the performance problem whatsoever, this runs amazingly fast even for multiple objects. I will leave it here for reference but wanted to make it clear this is not a performance issue. Thanks!

                                --------------
                                The waves themselves work great, really high FPS without any issues since it is calculated on the GPU, but to add in buoyancy requires duplicating the Gerstner wave formula (& wave clusters) in code which is called by the BuoyancyMovementComponent. To get realistic buoyancy you need to have at least 4 test points around an object, each one has its own location on the water surface. To find out how much force (and whether the force is gravity or upwards buoyant force) we need to create a snapshot of the current wave height for each of the 4 points, which requires going through the entire formula 64 times per frame (2 wave sets, 8 waves per set, 4 test points).

                                This is where the problem arises, all of those 64 calls to create a Gerstner wave are performed on the CPU which is much slower than GPU calculation. I am researching ideas on how to improve this, I have a few ideas that might work, but need to be tested. The most obvious way to cut it down is to reduce the wave count down to one cluster calculated for buoyancy, but still use the second cluster as small surface waves to increase the realism, which could work. But more on that later.
                                ---------------

                                For now I am off to create a new demo project containing all of this, once again for early adopters only due to performance issues... Hopefully it won't take to long, just need to migrate it all out of my master project. Will update again soon!
                                Last edited by DotCam; 01-24-2015, 03:01 PM.
                                Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                                Comment

                                Working...
                                X