No announcement yet.

[Community Project] WIP Weather & Ocean Water Shader

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

    Zoc I really appreciate you stepping forward to help maintain the project! I'll switch to this new version to test it and take advantage of the clean-up, getting back to original source releases should help the community here a lot.


      OptionalSteve Thank you! If you run into any issues, please report and I'll try to fix them


        Why do the waves stop at 0,0,0 like this?


          Originally posted by MikeRPG View Post
          Why do the waves stop at 0,0,0 like this?
          Do that happen in all maps included in the latest version?
          Last edited by Zoc; 10-05-2017, 03:21 AM. Reason: Adding Spoilers


            I have been using this ocean asset for a long time and it is excellent. Thanks so much to all involved. My main map is an island and I need a way to dynamically change the wave direction based on where the player is so waves always move towards the shore. I understand how to change direction in the editor and I have tried manipulating those same values within BP but it does not seem to work in game. Debugger shows the values are changing, it just does not change anything in-game. Can someone please tell me the best way to accomplish this? Thanks so much!


              Im curious, how are the waves being created in this project? is it using a procedural mesh? or animated mesh?


                Can I use this for commercial release? Want acknowledgement in the credits?


                  Can someone please make or link to a recent video of the asset and it's features? all I can find on the net is quite old


                    How do I import this into a project I am already working on?


                      I would like to animate the Global Wave Amplitude (Ocean Manager) in the sequencer. I guess it is possible but didnt find it for the moment.
                      I seen the variable in the BP_Ocean but it is not exposable to cinematic. I added a new variable that I multiplied with it. I seen it has an influence but I still can't animate it.
                      What is the good workflow to animate the wave amplitude in sequencer?
                      thank you


                        Originally posted by DotCam View Post
                        Welcome to the community created Ocean Simulation, Weather, and Dynamic TOD system. The point of this project is twofold. First, it aims to provide a realistic ocean water simulation that is both highly customizable, and being as physically accurate as possible. The second aspect is in regards to the weather and time-of-day setup.

                        The reason the Weather/TOD is in the same project is due to how much of the ocean itself is driven by the weather around it, to allow integration of real life ocean simulation, both parts are necessary for effects such as wind, rain, and storms. The Beaufort Scale will be implemented to allow custom control of the sea state and weather in one place.

                        This project is maintained by:
                        - DotCam
                        - TK-Master

                        List of Contributors

                        - Handkor - Initial Shader + Code for Buoyancy
                        - Nadrugal - Additions to the SkyDome
                        - Komodoman - Fish flocking AI and a variety of fish
                        and more to be added shortly, currently rewriting this post.

                        Want your name on this list? Feel free to make improvements to the OceanDemo project, and either PM me or Post in the thread below with your addition! Even if you don't think you can help yet, that's no problem! Any suggestions can be left by posting below as well.



                        To download (or fork) the project, use the GitHub link below.

                        GitHub Link -


                        This system uses techniques from many tutorials, however it would not have been possible without the help of the following users (Especially Handkor, he deserves a lot of credit for this!):
                        Handkor, JBaldwin, berna , ufna, Ehamloptiran, KhenaB, gregdumb and many others. Click on their names to see the corresponding threads!

                        For those wanting more info on how the waves are created mathematically, THIS ARTICLE goes over everything. Specifically have a look at the section on "Gerstner Waves" for the actual equations that produce the waves.


                        Newest Features

                        TK-Master added in a bunch of new features during my absence, these are available for the 4.8 & 4.9 versions on GitHub.



                        (Click for original size)


                        (Click for original size)


                        (Click for original size)

                        New features:

                        -Screen Space Reflections (SSR)
                        -Planar Reflection support
                        -Infinite Ocean System
                        -Distance Blended Normals
                        -Configurable Sets of Panning Normals (Small, Medium, Far)
                        -Heightmap-based Seafoam & Foam Wave Caps (Thanks Tin Le!)
                        -Cubmap-based Reflections (optional)
                        -Exposed many parameters to BP_Ocean. - You can now easily switch between shader versions, change textures, normals, foam, cubemap, heightmap etc.
                        -Underwater Distortion Effect
                        -Underwater Caustics

                        -Fixed buoyant destructible physics (too "jumpy")
                        -Fixed a few other problems caused by 4.8 engine core changes

                        Current known issues:
                        SSR shader version uses 14 samplers (might not work in linux/mac.. please let me know)

                        New Skydome Features

                        I'm releasing the latest code changes for the new Skydome I'm working on in stages. I want to make sure this first part's accuracy is rock solid before adding additional parts, as they will be dependent on sun/moon positions during the day & year. So this is the first of a series of upcoming skydome changes.

                        This update is the high accuracy sun & moon positioning, based on the input latitude, longitude, UTC offset, and local time. The calculations for this are very complex, and boring, so I'm only going to go over the values shown in the Debug HUD.

                        First, what you will see when you open the project, and how to set it all up for your desired location:

                        When you open the project, you will be in a demo level named dcSkyTestMap, which is a copy of the Island Map level with the skydome added. (if you don't want to use the new skydome, the Island Map still has the old one). These 2 arrows will show you the direction of the Sun/Moon (yellow/gray) and will update themselves appropriately, and the compass is set to North == +X axis (has not been rotated, default world placement).

                        To change the date & time, select the BP_Sky reference in the World Outliner, and expand the small arrow beside Local Time in the Default section. Here you will also find the controls for Latitude, Longitude, UTC Offset Hours, whether to allow Daylight Savings time (calculated automatically if enabled), and a Time Scale Multiplier which allows you to speed up (or slow down) time. By default this is set to 10 which means 10 seconds of game time goes by every 1 second in real world time.

                        The values are automatically clamped in code to the maximum number of seconds in a minute (59), max hours in a day (23), max days in the current month (28 to 31), etc. I had clamped the sliders to not exceed these values, but for some reason it won't allow you to change the value with it turned on, so just be aware that values greater than min/max do not have any effect.

                        Finally we have the Debug HUD, this will look very confusing to most people, but is as simple as I could make it while still providing the necessary information. Here's what it looks like, the values are broken down below:

                        The best way to verify this data is to use this website and enter in the date/time, latitude & longitude info into these boxes (or use the map, but make sure the lat/long are correct):

                        With that entered, all of the other fields will populate themselves with data. The values in game vs the values on the website will vary slightly (0.1 to 2 degrees average) and are not meant to be exact, calculating the exact position is not feasible (or necessary) for a game / simulation. Using approximations allows high accuracy, without performance concerns.

                        Now, what these values mean:

                        - Time Correction Factor (TCF): The number of minutes to add/subtract to account for the variation in Solar Time within a gives time zone.
                        - Equation of Time (EOT): An equation that corrects for the eccentricity of the earth's orbit and axial tilt for the given date/time.
                        - Hour Angle (HRA): Converts Solar Time to the number of degrees the sun has moved. 0 == sun's highest point, so the value will be negative in the east (morning) and positive in the west (evening)
                        - Declination: The earth's axial tilt for the given date/time vs the sun. This varies from -23.4397 (northern hemisphere winter) to +23.4397 (northern hemisphere summer).
                        - Altitude Angle: The vertical angle of the sun in the sky measured from the horizontal, 0 = sunrise, 90 = highest point of the sun that day (time varies) **NOTE: For this value to work in UE4 coordinates we need to subtract 180 from the result, this is why the value differs in the actual rotator' pitch value.
                        - Azimuth Angle: The horizontal compass direction of the sun. At solar noon this angle will be exactly due south (-180) (local time varies)
                        - Current Rotator Value: The current rotation of the Sun's Directional Light.

                        References used for solar positioning:

                        - Approximations L/M/F: These are approximations for the location of the moon in it's orbit around the earth, including the inclination of the orbit, orbital eccentricity, arg of perigee, and longitude of ascending node
                        - Ecliptic Longitude: The longitude location of the moon on the celestial sphere.
                        - Ecliptic Latitude: The latitude location of the moon on the celestial sphere.
                        - Mean Distance (km): The distance of the moon from earth, in kilometers.
                        - Declination: Similar to the solar declination, this is the angle of the earth's axial tilt, but also takes the inclination of the moon's orbit into account.
                        - Right Ascension: Angular position of the moon measured eastward along the celestial equator. Both right ascension and lunar declination are found by converting from ecliptic to rectangular coordinates (x/y/z), rotating to account for earth's axial tilt, then converting back into spherical coordinates.
                        - Sidereal Time: A time scale (measured in degrees) based on the rate of earth's rotation relative to fixed stars, rather than the sun. This is a constant value that varies only by location (not time), which differs from the actual definition of Sidereal Time, we only use it as a reference.
                        - Hour Angle (HRA): Similar to the sun HRA, however is measured against sidereal time instead of solar time. The number of degrees the moon has moved from time 0 (0 to 360 degrees).
                        - Altitude Angle: Same as the sun, vertical height of the moon. Value is found by converting Ecliptic (celestial sphere) coordinates to geocentric (observer to sky) coordinates.
                        - Azimuth Angle: Same as the sun, horizontal compass direction of the moon. Value is found by converting Ecliptic (celestial sphere) coordinates to geocentric (observer to sky) coordinates.
                        - Current Rotator Value: The current rotation of the Moon' Directional Light.

                        References used for lunar positioning:

                        There is an excellent video explaining the basics of how we calculate the time of day, calendar systems, and the earth's rotation in the following video (which came out the day after I posted this). Highly recommend watching it to get a good idea how this works:

                        All of the above calculations are implemented in the plugin to ensure there are no performance issues. The blueprint BP_Sky is based off the TimeManager class (in the plugin) and uses it's functions to calculate the sun/moon/moon phases in the base class. This makes the blueprint much easier to read, and reduces it's complexity considerably. These functions could be used by any actor, such as a custom skydome system, by either adding the actor as a child, or inheriting from the actor and calling the Calculate xxx functions.

                        Please try it out, let me know how it works for you, and whether you have any problems. I have been testing the system out and so far it seems to be working great, but feedback would be much appreciated!

                        Version 4.12.2 has now been released.

                        You can download the new release (and all other versions) from GitHub here
                        How do I import the Ocean into a project I am already working on?


                          Hello DotCam is article that explains the mathematical principle of the waves cannot be accessed.
                          The link cannot work


                            Anyway to simulate beach waves properly? or at least change the direction of the waves within an area to go towards the island?
                            Last edited by MrWilson13; 10-19-2017, 04:19 PM.
                            Just added our project to DBIndie. 17/07/16


                              Originally posted by MrWilson13 View Post
                              Anyway to simulate beach waves properly? or at least change the direction of the waves within an area to go towards the island?
                              There's a setting on the ocean object for the terrain heightmap, I believe if set it's used to calm down the waves at beach areas.

                              Storyteller - An immersive VR audiobook player

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


                                Hi, first, thank you so much for this great plugin and the work by all of you. The shader looks really beautiful.

                                Currently I'm going to try a night scene with the Ocean Plugin. But I have the problem, that it looks like (oceannight3.png).

                                I photoshopped this picture to show you what I want to implement.

                                My question: Is it possible to change the settings in BPs like my photoshopped pic?

                                I tried a lot, tried to change BP Params, tried to change inside of materials. But I could not hide the shine at the horizont.

                                Please help ^^ I dont know what else I can do.

                                And again, thank you so much for this great Plugin.

                                Best regards,