Announcement

Collapse
No announcement yet.

[Community Project] WIP Weather & Ocean Water Shader

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Whoops... Didn't realize there were so many new posts, sorry for the delay everyone!

    Originally posted by Avolanty View Post
    It doesn't have his older .h and .cpp, but I'm glad that you have advanced it so much. This will take me a while to configure everything. Good news is that I was able to merge my progress over to your demo. I have flying AI moving over the water patrolling and shooting at me. Now I just need to spend some time in Maya and make some warships to get the effect I want.

    Oh here is my Channel, its a work in progress
    https://www.youtube.com/watch?v=sUjgiNXWAEA
    Yeah sorry about that, but I don't have a copy of the original code. I use the main structure of it and then add in a couple of Structs to hold variables to allow the individual Gerster waves to be modified more easily from a blueprint, otherwise the basic setup can all be seen in Handkor's video. He doesn't show the .h file but the OceanManager.h in the latest download can be modified to change it back to his original code pretty easily. The OceanManager code will not provide buoyancy on it's own though, you will need to setup a blueprint to handle the calculations. I have a nearly complete version of it in the original download, called BP_OceanManager, but it is not fully working.

    At some point in the future I will see about making a blueprint only version. It can be done, but will likely be much slower than the code version. I have managed to get the code working as a plugin now, so hopefully that eliminates the current issues when trying to migrate the content out to another project.

    Originally posted by Avolanty View Post
    OK got it floating now, you can see the patrolling ai in the back of the picture, now I just need to get it moving. This will probably take a while bear with me.
    Looking good Avolanty! Let me know if you run into any issues with the buoyancy part.

    Originally posted by extropy View Post
    Hello folks this is very impressive work!

    I am new to game dev, but one of my 'learning projects' is to make a stylised-simplified ocean - Im learning a lot from what you have done

    My question is simple:
    -setting up a material function to generate Gerstner waves I understand (thanks Handkor)
    - In order to mimic bouyancy and have objects sliding down waves Id like to sample the wave height at points relative to the floating object's centre
    - you do this in code, Im trying to do it in blueprints, so (heres the question)

    Q how can you sample the output of a material function at specific points, in a blueprint?

    Ive trawled the documentation and you would think that it would be a fairly common thing to do,
    but I cant see it

    i.e. return (property) from material function(MF_given) at (x,y)

    The other way is to use a RenderTarget, I gather, but this is expensive

    thanks for any help
    Hey there, as far as I know it is not possible to output the calculation from the material. I have instead been looking into possibly calculating the waves in code and passing the end result to the material through a Material Parameter, but the other way around is not currently possible.

    Take a look at the BP_OceanManager blueprint from the original download (on the first page of this thread), it has nearly everything needed to do exactly what you are looking for, except it goes going from blueprint to material through a MaterialParameterCollection. I never got this working properly, but it is something I will look into further in the future. If you are able to get it working I would love to hear about it!!

    Originally posted by eXtreme View Post
    Guys, terrific work!
    I always liked looking at CG water

    I'm sure you've seen this, but if you didn't, I think this guy did a pretty good job of the "ocean" touching beach effect
    https://www.youtube.com/watch?v=u82fxXHBFhA

    Great work, keep it up!
    I definitely have seen these videos! I am pretty sure I have seen pretty much all of the UE4 ocean videos out there, I wanted to see how everyone else put it together so I have (and still do) look for them. The method he is using for the shore is a depth fade, which I use as well and could configure it to look very similar, plus removing the current shore foam. This is an area where the material has improved recently, hope to have it out shortly.

    Originally posted by Komodoman View Post
    Hey DotCam,

    I have been working on a senior project for college with an Aquarium. The work you have done is great, and I was wondering if you would be interested in my fish flocking c++ code as a contribution to this project. Over the last week I have implemented boids flocking into our team's ue4 project. My current code creates semi-realistic fish school behaviors. The code also allows you to create a "predator" fish, so the fish not only school, but are apprehended by predators and flee and re-group in a semi-realistic manner. I'll post a video showing my current progress tomorrow if I have time. If this would interest you at all let me know, I would love to be a contributor and further the ue4 community!
    Originally posted by Komodoman View Post
    Here's my initial flocking implementation for your enjoyment, the video quality is ****, and the playback freaks out when I go above the water, but you get the gist of the flocking:
    Hey Komodoman,

    That looks really cool, I would love to add it to the project!

    I am currently working with two separate projects. One is mainly for above the surface with buoyancy, and the other is all of the above plus an underwater area where a character could swim, or go diving etc. So that would fit really well with the second version.

    So absolutely it would be great if you can provide it as well! The underwater part is rather boring at the moment... no plant, fish or anything. Just trying to get the look and the physics right currently, but I will need fish!

    Thanks for offering! I think that would make a great addition.

    EDIT: Have you been able to figure out why everything goes crazy out of water? If this is being caused by this project please let me know if I can help in any way. It looks almost like the turtle is leaving the water and the calculation is stalling, but I can't make out the red error text from the video. Again, let me know if I can help!
    Last edited by DotCam; 02-11-2015, 04:28 PM.
    [Free Community Project/Plugin] WIP Dynamic Ocean & Calendar Based Sky
    New Features:: Highly accurate sun/moon position, and lunar phase calculations built into the plugin (base class for the SkyDome blueprint)
    In Progress: Weather simulation w/ volumetric clouds

    Comment


    • Originally posted by Komodoman View Post
      Here's my initial flocking implementation for your enjoyment, the video quality is ****, and the playback freaks out when I go above the water, but you get the gist of the flocking:

      Awesome Komodoman!!! ;D Jet Turtles or the new Turtle Simulator 2015 :P Fish flocking looks crazy cool!!

      Comment


      • Originally posted by DotCam View Post

        Hey Komodoman,

        That looks really cool, I would love to add it to the project!

        I am currently working with two separate projects. One is mainly for above the surface with buoyancy, and the other is all of the above plus an underwater area where a character could swim, or go diving etc. So that would fit really well with the second version.

        So absolutely it would be great if you can provide it as well! The underwater part is rather boring at the moment... no plant, fish or anything. Just trying to get the look and the physics right currently, but I will need fish!

        Thanks for offering! I think that would make a great addition.

        EDIT: Have you been able to figure out why everything goes crazy out of water? If this is being caused by this project please let me know if I can help in any way. It looks almost like the turtle is leaving the water and the calculation is stalling, but I can't make out the red error text from the video. Again, let me know if I can help!
        Hey DotCam,
        The craziness when out of the water is due to the video recording software I used, so don't worry about it . Next time I'll try to use a better screen capture. The above water looks fine, and hopefully it shows up better next time I record. The red output is just "eating" when a shark eats a fish. It was used for debugging is all.

        Vodoo,
        Thanks for the compliment! Hopefully I'll be able to give you all the c++ files and a short tutorial on how to implement the flocking in your own ue4 scenes!

        Comment


        • Hehe looks like water is getting quite popular in 2015 if it ever stopped being popular..

          Great to hear it, can't wait for an update.. Feel really bad because I can't contribute anything, this is way out of my current league, but still like playing with it..

          Curious about one thing - sound. How can that be handled in more realistic manner? Sure, slapping "ocean" sound would work, but is it possible to like get multiple sound files, ie:

          sound1 - when the ocean is calm
          sound2 - when the wave breaks
          sound3 - when the wave is reaching its peak
          sound4 - when the wave is "losing" its altitude/power

          Then, to somehow wire it up so particular sound fires off when some condition happens. For example when each wave hits and breaks (don't know the correct terminology, sorry all) on the beach it should fire the sound2, when wave reaches its peak, sound3 fires off.. And all this sounds fires for each individual wave based on certain radius from the player (so it doesn't take much of the performance).. then if player was to fly over the ocean, the sounds should be as realistic as possible because each sounds particularly describes each wave that's in proximity..

          Could be an overkill, just saying and wondering

          EDIT: Actually that seems like OVERKILL, now that I think about it.. Totally unnecessary, forget I mentioned it..
          Last edited by eXtreme; 02-11-2015, 05:03 PM.

          Comment


          • Originally posted by eXtreme View Post
            Hehe looks like water is getting quite popular in 2015 if it ever stopped being popular..

            Great to hear it, can't wait for an update.. Feel really bad because I can't contribute anything, this is way out of my current league, but still like playing with it..

            Curious about one thing - sound. How can that be handled in more realistic manner? Sure, slapping "ocean" sound would work, but is it possible to like get multiple sound files, ie:

            sound1 - when the ocean is calm
            sound2 - when the wave breaks
            sound3 - when the wave is reaching its peak
            sound4 - when the wave is "losing" its altitude/power

            Then, to somehow wire it up so particular sound fires off when some condition happens. For example when each wave hits and breaks (don't know the correct terminology, sorry all) on the beach it should fire the sound2, when wave reaches its peak, sound3 fires off.. And all this sounds fires for each individual wave based on certain radius from the player (so it doesn't take much of the performance).. then if player was to fly over the ocean, the sounds should be as realistic as possible because each sounds particularly describes each wave that's in proximity..

            Could be an overkill, just saying and wondering

            EDIT: Actually that seems like OVERKILL, now that I think about it.. Totally unnecessary, forget I mentioned it..
            Actually we could make a simple blueprint that plays sound whenever a wave passes over it. Just place the blueprint higher than the water plane and have it monitor water height at it's point. Placing one of these on a beach would give you the trigger you need for a wave hitting the shore.

            But a general ambient ocean sound matching the wind conditions would be enough and for the beach just having a periodic should of a series of wave crashing would also do.

            Now that probe I mentionned would be very useful near rock formations as you can have it trigger a particle spray at the same time a wave hits. This way you get to see and hear crashing waves.

            Comment


            • Ya that is Sick!!! Good job everyone.
              -----------------------------
              SORiN interactive games llc.
              www.sorininteractive.wordpress.com
              a short AAA 3rd person video game - join my crew

              Comment


              • Hey everybody!

                Great news, I have combined predator and flocking fish into one c++ file. Now flocks can pursue other flocks . I will try to give out my initial code this weekend and post another video. I finally was able to get everything into the c++ file, so there is no need for any blueprint gobbledygook. It is easy as parenting a blueprint to the "fishflock" class I have made, and giving it the attributes you desire: enemy types, prey types, neighbor type, speed, turnSpeed, distanceFromLeader (min, max) , (boolean) isLeader, pursueDistance, fleeDistance, pursueSpeedMultiplier, fleeSpeedMultiplier, distanceFromNeighbors, max/min vector of underwater box, and a few others I may have forgot to mention.

                There are still many issues that I want to clear up in the next few months, but since our project team only has 7 weeks to complete a game, I wont be able to work more on this for the next 3 weeks. Some of the current issues I want to fix/add: avoidance behavior when the fish sees a mesh, better steering when near top of water/sea floor, better spawning, better flock v. flock behavior, and smoother movement.

                Cheers!
                Komodoman
                Last edited by Komodoman; 02-14-2015, 12:33 AM. Reason: A few more variables

                Comment


                • I'm new to unreal engine and this looks amazing could you explain how I would add this to my project in unreal engine in other words where do i put the files i download any tips would be greatly appreciated!!

                  Comment


                  • Originally posted by eXtreme View Post
                    Curious about one thing - sound. How can that be handled in more realistic manner? Sure, slapping "ocean" sound would work, but is it possible to like get multiple sound files, ie:

                    sound1 - when the ocean is calm
                    sound2 - when the wave breaks
                    sound3 - when the wave is reaching its peak
                    sound4 - when the wave is "losing" its altitude/power

                    Then, to somehow wire it up so particular sound fires off when some condition happens. For example when each wave hits and breaks (don't know the correct terminology, sorry all) on the beach it should fire the sound2, when wave reaches its peak, sound3 fires off.. And all this sounds fires for each individual wave based on certain radius from the player (so it doesn't take much of the performance).. then if player was to fly over the ocean, the sounds should be as realistic as possible because each sounds particularly describes each wave that's in proximity..
                    Handkor answered this already with an ideal solution, so I will add the info to my todo list on the Trello board. Thanks for the suggestion, and thanks for the explanation Handkor!


                    Originally posted by Komodoman View Post
                    Hey everybody!

                    Great news, I have combined predator and flocking fish into one c++ file. Now flocks can pursue other flocks . I will try to give out my initial code this weekend and post another video. I finally was able to get everything into the c++ file, so there is no need for any blueprint gobbledygook. It is easy as parenting a blueprint to the "fishflock" class I have made, and giving it the attributes you desire: enemy types, prey types, neighbor type, speed, turnSpeed, distanceFromLeader (min, max) , (boolean) isLeader, pursueDistance, fleeDistance, pursueSpeedMultiplier, fleeSpeedMultiplier, distanceFromNeighbors, max/min vector of underwater box, and a few others I may have forgot to mention.

                    There are still many issues that I want to clear up in the next few months, but since our project team only has 7 weeks to complete a game, I wont be able to work more on this for the next 3 weeks. Some of the current issues I want to fix/add: avoidance behavior when the fish sees a mesh, better steering when near top of water/sea floor, better spawning, better flock v. flock behavior, and smoother movement.

                    Cheers!
                    Komodoman
                    Sounds good man! Take your time, it's no rush. Look forward to seeing what you come up with!


                    Originally posted by chris978 View Post
                    I'm new to unreal engine and this looks amazing could you explain how I would add this to my project in unreal engine in other words where do i put the files i download any tips would be greatly appreciated!!
                    Hi there! Welcome to the forums

                    The download is actually a complete project you can open by double clicking the "OceanDemo.uproject" file from the OceanDemo folder after you extract the zip file. The latest download is for UE4 version 4.6.1.

                    Right now it is a huge pain to transfer out the files to another project, but I will have that fixed for the next version using a plugin instead. Let me know if you need some more info!
                    [Free Community Project/Plugin] WIP Dynamic Ocean & Calendar Based Sky
                    New Features:: Highly accurate sun/moon position, and lunar phase calculations built into the plugin (base class for the SkyDome blueprint)
                    In Progress: Weather simulation w/ volumetric clouds

                    Comment


                    • Yes i figured it out now i was trying to use it as a plugin!! thanks alot for that info

                      Comment


                      • Will the weather/skydome also be included in the plugin version?
                        --
                        Joshua
                        Multimedia Artist, Druid Gameworks
                        www.joshuaezzell.com
                        www.druidgameworks.com

                        Comment


                        • Originally posted by joshezzell View Post
                          Will the weather/skydome also be included in the plugin version?
                          Currently it is 100% blueprint so there is no need to add it to a plugin, all you need to do is migrate the Sky folder over to your project and drop the BP_Skydome into your level. It is totally possible to create a content only plugin (no code), so if there is enough demand for it I can create a separate plugin for it as well, but currently it is not really necessary.

                          So I'll leave it up to you guys, I will add a card to my Trello board for a Plugin based Skydome. It will not be included in the same plugin though, it would be on its own.

                          I forgot to mention it earlier but coming in UE4 version 4.7 you will be able to create Blueprintable Components. This will allow moving the BuoyancyMovementComponent in code over to a blueprint component, and then the remaining connection can be implemented into the BP_Ocean blueprint (performing the OceanManager functions). This is not a high priority currently and 4.7 hasn't been released, but I thought I would mention that a blueprint-only setup will be easier to create soon.
                          [Free Community Project/Plugin] WIP Dynamic Ocean & Calendar Based Sky
                          New Features:: Highly accurate sun/moon position, and lunar phase calculations built into the plugin (base class for the SkyDome blueprint)
                          In Progress: Weather simulation w/ volumetric clouds

                          Comment


                          • Originally posted by DotCam View Post
                            Currently it is 100% blueprint so there is no need to add it to a plugin, all you need to do is migrate the Sky folder over to your project and drop the BP_Skydome into your level. It is totally possible to create a content only plugin (no code), so if there is enough demand for it I can create a separate plugin for it as well, but currently it is not really necessary.

                            So I'll leave it up to you guys, I will add a card to my Trello board for a Plugin based Skydome. It will not be included in the same plugin though, it would be on its own.

                            I forgot to mention it earlier but coming in UE4 version 4.7 you will be able to create Blueprintable Components. This will allow moving the BuoyancyMovementComponent in code over to a blueprint component, and then the remaining connection can be implemented into the BP_Ocean blueprint (performing the OceanManager functions). This is not a high priority currently and 4.7 hasn't been released, but I thought I would mention that a blueprint-only setup will be easier to create soon.
                            Sweet. I assume the skydome is packaged with the 0.2 download?
                            --
                            Joshua
                            Multimedia Artist, Druid Gameworks
                            www.joshuaezzell.com
                            www.druidgameworks.com

                            Comment


                            • Originally posted by joshezzell View Post
                              Sweet. I assume the skydome is packaged with the 0.2 download?
                              Yes it is in there currently and is contained in the "Sky" folder. If you want to migrate it out to your own project just right click on the "Sky" folder -> Asset Actions -> Migrate and choose your projects content folder. To get the sun working you need a Movable directional light in your scene, and then in the details panel for the Skydome set your "Sun Light Source" to the directional light. Oh and you will probably want to disable "Lightning Active" in the details panel as well, I set it to default to active by mistake...

                              The Skydome has not had as much work done to it as the ocean, but it is a good starting point for sure. I am replacing the current "CloudSphere" mesh with a new mesh that is shaped a bit better, and may end up using multiple cloud spheres to add in some more depth. The current cloud material just plain sucks tbh, I'll be the first to admit it, its tiling is awful, so I am working on improving that and adding in more variation.

                              But yes, it is all there in the project!
                              [Free Community Project/Plugin] WIP Dynamic Ocean & Calendar Based Sky
                              New Features:: Highly accurate sun/moon position, and lunar phase calculations built into the plugin (base class for the SkyDome blueprint)
                              In Progress: Weather simulation w/ volumetric clouds

                              Comment


                              • Well, I am looking forward to seeing it updated! I just started trying it out. Very easy to setup.

                                I want to suggest a feature or two. A separate Time Scale for night. This would handy in the case that you want time at night to go by quicker. Several recent games have used this including Far Cry 4 and Dying Light.
                                Along with the new Lunar Moon Cycles you have on the trello, I would like to see an accurate orbit. For instance, during the day we can often see the moon in the sky. Maybe I am missing something in the settings that allows a proper setup for this?

                                If I can think of any more handy features, I'll be sure to post them.

                                EDIT: Also, is there any particular reason that Atmospheric Fog isn't being used?
                                Last edited by joshezzell; 02-14-2015, 05:47 PM.
                                --
                                Joshua
                                Multimedia Artist, Druid Gameworks
                                www.joshuaezzell.com
                                www.druidgameworks.com

                                Comment

                                Working...
                                X