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 DotCam View Post
    Ok, I have some good news and some incredibly awesome news for you guys! First the incredibly awesome news:

    Performance is no longer an issue

    I found the bug,
    [snip]
    So what was the bug? Was it something in my code?

    Comment


      Originally posted by Handkor View Post
      So what was the bug? Was it something in my code?
      Nope not at all, your code works amazingly well! Hardly any measurable impact on performance for a single object. I thought calling GetWaveHeight and recreating each wave cluster for each test point on Tick would be more taxing, but it works great even with multiple actors!

      Ah yes, so about that bug... Well it ended up being something I totally overlooked. The default value of a variable was reset to 0 within a migrated blueprint, which shouldn't happen, it was within the blueprint itself not in the scene. Migrating between projects has turned up a couple of issues in the past as well, should have expected it... The value controlled how often to update the Skylight capture, which is very costly performance wise. Instead of updating every 10 minutes it was updating every Tick, causing a CPU stall every other frame preventing the BuoyancyComponent/OceanManager from executing.

      Yes it was a bit of a stupid mistake on my part (just a little), but good news is I now know how to use the profiler properly! So something good resulted from my utter failure.

      Big thanks for everything though, it is working great! In the process of putting together a drivable boat right now, it's a lot of fun!
      Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

      Comment


        Originally posted by DotCam View Post
        Nope not at all, your code works amazingly well! Hardly any measurable impact on performance for a single object. I thought calling GetWaveHeight and recreating each wave cluster for each test point on Tick would be more taxing, but it works great even with multiple actors!

        Ah yes, so about that bug... Well it ended up being something I totally overlooked. The default value of a variable was reset to 0 within a migrated blueprint, which shouldn't happen, it was within the blueprint itself not in the scene. Migrating between projects has turned up a couple of issues in the past as well, should have expected it... The value controlled how often to update the Skylight capture, which is very costly performance wise. Instead of updating every 10 minutes it was updating every Tick, causing a CPU stall every other frame preventing the BuoyancyComponent/OceanManager from executing.

        Yes it was a bit of a stupid mistake on my part (just a little), but good news is I now know how to use the profiler properly! So something good resulted from my utter failure.

        Big thanks for everything though, it is working great! In the process of putting together a drivable boat right now, it's a lot of fun!
        Great, good you found it. btw the demo video looks great.

        Now lets see if all this work is invalidated by what the engine guys are showing in the twitch stream.

        Comment


          So some interesting stuff was shown in the twitch stream (although nothing mind blowing tbh ), I can easily see a combination of all that foam/normal panning stuff + the current gerstner wave displacement to make it look more alive.

          In regards to displacement however, the ideal and "final" solution will probably be WaveWorks (or some equivalent FFT implementation anyway) with some gerstner waves blending for the shallow areas perhaps (really wish I could get buoyancy working with WaveWorks to test that out I will try to ask Mike again about that boat demo).

          Has anyone checked the 4.8 branch by any chance? it is said to have improved specular highlights/reflections on translucent materials about frickin time I guess
          Last edited by TK-Master; 01-23-2015, 04:13 PM.

          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
            So some interesting stuff was shown in the twitch stream (although nothing mind blowing tbh ), I can easily see a combination of all that foam/normal panning stuff + the current gerstner wave displacement to make it look more alive.

            In regards to displacement however, the ideal and "final" solution will probably be WaveWorks (or some equivalent FFT implementation anyway) with some gerstner waves blending for the shallow areas perhaps (really wish I could get buoyancy working with WaveWorks to test that out I will try to ask Mike again about that boat demo).
            Yes exactly, Tessendorf's technique is what WaveWorks uses, combination of Gerstner waves and FFT. It is a stretch goal, but one I plan to figure out and implement some time in the future.

            But to be clear, absolutely no time-frame, no guarantee, might not happen, we'll have to see, etc.
            Here is the Tessendorf paper outlining how it works: http://graphics.ucsd.edu/courses/ren...tessendorf.pdf
            AC: Black Flag (and AC 3) used the same technique as well with some stunning results, using it as a reference for techniques as well: http://www.fxguide.com/featured/assa...th-the-action/

            Adding in a height field with noise is a simple solution for now, it adds a lot of choppiness to the waves. The waves shown on the twitch stream today are very close to the ones shown in the GDC 2014 demo available for download in the Learn tab of the launcher. I have been taking pieces of it apart and adding them to the material with some success, I just didn't include it in the dl from the other day since it is still WIP. It does add a lot of dimension to the waves, and will be included at some point.

            Has anyone checked the 4.8 branch by any chance? it is said to have improved specular highlights/reflections on translucent materials about frickin time I guess
            Yeah I noticed that as well, planning to go through it all later today or tomorrow. The one (only) image I've seen so far is promising, it looks much better than it currently does. Here is the image:
            https://forums.unrealengine.com/show...l=1#post207538
            Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

            Comment


              Hey DotCam,

              Amazing work! My project team has been using your buoyancy + ocean and it looks amazing. We are anxiously awaiting the release of an underwater FX version, since the game we our creating will be featured mostly underwater. We were wondering if you have messed around with light shining through your water material. We are trying to get a realistic water effect and light beams that shine through, have any advice? Also do you have an ETA on your release for underwater FX? Would like to know if you plan to release it before March. Thanks for this great project and keep on trucking !

              Comment


                Originally posted by Komodoman View Post
                Hey DotCam,

                Amazing work! My project team has been using your buoyancy + ocean and it looks amazing. We are anxiously awaiting the release of an underwater FX version, since the game we our creating will be featured mostly underwater. We were wondering if you have messed around with light shining through your water material. We are trying to get a realistic water effect and light beams that shine through, have any advice? Also do you have an ETA on your release for underwater FX? Would like to know if you plan to release it before March. Thanks for this great project and keep on trucking !
                Oh yes it will certainly be before then! I'm just working on polishing up a few aspects, I don't want to give a hard date since it always seems to take me a couple extra days, but very soon!

                The light shining through is going to have to be faked right now using a Godray mesh/material, I have one set up and it works fairly well. I am trying to figure out the best solution to spawning these in game though, having them there all the time is just not going to work performance wise. It could be done in a blueprint, but it seems a bit overkill. One idea is to make them into particles that spawn inside a radius around the player when they enter the water. That should be doable, keep their lifetime up high enough and sort of fade in and out. I can easily output a parameter from the particle system that takes in the suns position so they are angled properly. Then we need the caustic effects on the ocean floor as well, I have the material for that done, just need to work out a system of applying it as a light function only while underwater.

                I'm trying to consolidate all of these ideas, so I decided to set up a Trello board. There are a few things missing, it's not quite done, but if you guys want to vote which features you want feel free! I will try and keep it up to date and add in more notes/cards as new ideas come in.

                So, Trello board for this project can be found here:
                https://trello.com/b/7dzOdkvw/ue4-ocean-weather-project

                If you have a feature you want included but is not yet listed, please post your idea here and I will add it in.

                Thanks guys!
                Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                Comment


                  Focus is obviously on the ocean, but some suggestions:

                  - Lunar / Moon cycles (material based moon crescents, etc.)
                  - Tidal shifts / changes (changing water plane height offset based on time of day / lunar cycles)
                  - Wind variation (fuzzy directional/strength wind which changes cloud / rain / snow direction (and perhaps ocean spray, too)).

                  I might have a go at helping out with some of the above. I had a pretty decent random wind direction/speed setup in an older project.

                  As for the underwater god rays, I would say particles is the best approach. It's only really something you'll see when looking up and near the surface, so spawning particles when needed won't be too difficult.
                  Really loving this whole project. Hopefully the community can pull together and create the best video game water/environmental system possible!

                  Comment


                    Awesome Trello board man I'm especially excited about the interaction stuff (fluid surface plugin style!) but I guess that's going to take some time

                    Personally I have been trying to implement a subsurface scattering effect and depth-based color (as shown in that AC III article) but I haven't gotten the results I'm looking for yet

                    Here is what I have got so far (huge image warning!):


                    Unfortunately it looks a lot worse in motion though


                    Here is the mat. function if you are interested..
                    Attached Files

                    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


                      That's getting pretty close! Wouldn't the effect be less obvious in the waves but more obvious towards the shore?

                      Comment


                        Wow, very nice!

                        How can I test this in my own project? I tried to migrate this to another project (Ocean folder --> Migrate) but when I try to open BP_Ocean blueprint after migration I get following message:

                        "The following member variables in blueprint 'Blueprint /Game/Ocean/BP_Ocean.BP_Ocean' have invalid type. Would you like to remove them?

                        Wave Set 1Parameters
                        Wave Set 2Parameters"

                        and

                        "Blueprint could not be loaded because it derives from an invalid class. Check to make sure the parent class for this blueprint hasn't been removed!".

                        Comment


                          Originally posted by TK-Master View Post
                          Awesome Trello board man I'm especially excited about the interaction stuff (fluid surface plugin style!) but I guess that's going to take some time

                          Personally I have been trying to implement a subsurface scattering effect and depth-based color (as shown in that AC III article) but I haven't gotten the results I'm looking for yet
                          Well you are getting pretty darn close! That looks excellent TK! With the HF noise displacement (choppy waves on the surface) I'm adding in right now, these two should look awesome when used together

                          That is looking really cool, great work man! We'll have to merge these together sometime. Do you use GitHub at all? I was thinking of using it so it's easy to organize it all. Anyways for now it's fine how it is, but something I might get to work on soon.
                          Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                          Comment


                            Originally posted by Skulburn View Post
                            Focus is obviously on the ocean, but some suggestions:

                            - Lunar / Moon cycles (material based moon crescents, etc.)
                            - Tidal shifts / changes (changing water plane height offset based on time of day / lunar cycles)
                            - Wind variation (fuzzy directional/strength wind which changes cloud / rain / snow direction (and perhaps ocean spray, too)).

                            I might have a go at helping out with some of the above. I had a pretty decent random wind direction/speed setup in an older project.

                            As for the underwater god rays, I would say particles is the best approach. It's only really something you'll see when looking up and near the surface, so spawning particles when needed won't be too difficult.
                            Really loving this whole project. Hopefully the community can pull together and create the best video game water/environmental system possible!
                            That would be awesome if you are able to help!! It's been a fun project so far, but I would love to have contributions!

                            Those are great suggestion! I will add them to Trello momentarily.

                            Speaking of contributions, a good friend of mine "HitPawz" has graciously provided a swimming animation and a treading water idle animation I will be retargeting onto the blue guy, so we will be able to swim!

                            So a big thank you to HitPawz for doing that, he will also be added to the contributors list! It's still a small list, but I am thrilled to see it is growing! Thanks guys!
                            Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                            Comment


                              Originally posted by tkorkalainen View Post
                              Wow, very nice!

                              How can I test this in my own project? I tried to migrate this to another project (Ocean folder --> Migrate) but when I try to open BP_Ocean blueprint after migration I get following message:
                              I'm sorry to say that migrating the ocean out is waaay to difficult at the moment... Sorry about this, I am currently looking into how difficult it would be to package it up as a plugin. Currently you have to do a lost of copying/pasting code, generating the code, etc.

                              If you are using blueprints there is no simple way to do this, I hope to have this fixed ASAP! I just need to read up on the documentation, and if it is fairly easy to do, I could have it done within a week or two. Sorry for the inconvenience.
                              Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                              Comment


                                Originally posted by DotCam View Post
                                I'm sorry to say that migrating the ocean out is waaay to difficult at the moment... Sorry about this, I am currently looking into how difficult it would be to package it up as a plugin. Currently you have to do a lost of copying/pasting code, generating the code, etc.

                                If you are using blueprints there is no simple way to do this, I hope to have this fixed ASAP! I just need to read up on the documentation, and if it is fairly easy to do, I could have it done within a week or two. Sorry for the inconvenience.
                                Sounds good and no rush. This is something so nice I can wait Too bad I'm not skilled enough (at least not yet) to contribute and help with this matter.

                                Comment

                                Working...
                                X