**Welcome to the community created Simulation, Weather (WIP), and Dynamic TOD system! **
**The point of project is twofold. First, it aims to provide a realistic 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 itself is driven by the weather around it, to allow integration of real life simulation, both parts are necessary for 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.**
project is currently being maintained by:
- @anonymous_user_0df12f74_
- @
- @
âââââââ- @EvoPulseGaming - @
List of Contributors
-
- Initial Shader + Code for Buoyancy
- Nadrugal - Additions to the SkyDome
-
- Fish flocking AI and a variety of fish
and more to be added shortly, currently rewriting post.
- Fish flocking AI and a variety of fish
Want your name on 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.
Thanks!
----------------------------------------------------------------------------------------------------------------------------------------------------------
To download (or fork) the project, use the link below.
** Link** - https://.com/UE4-OceanProject/OceanProject
----------------------------------------------------------------------------------------------------------------------------------------------------------
system uses techniques from many tutorials, however it would not have been possible without the help of the following users (Especially , he deserves a lot of credit for !):
, JBaldwin, berna , ufna, , 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, ARTICLE goes over everything. Specifically have a look at the section on âGerstner Wavesâ for the actual equations that produce the waves.
----------------------------------------------------------------------------------------------------------------------------------------------------------
Newest Features
added in a bunch of new features during my absence, these are available for the 4.8 & 4.9 versions on .
Screens:
SSR
http://www.mediafire.com/convkey/ea7f/9ifotl4151ob4d2zg.jpg?size_id=6
(Click for original size)
Foam
http://www.mediafire.com/convkey/03a1/octvtnvf2kpam4gzg.jpg?size_id=6
(Click for original size)
Shore
http://www.mediafire.com/convkey/f095/70xpo3gp13mprlszg.jpg?size_id=6
(Click for original size)
New features:
-Screen Space Reflections (SSR)
-Planar Reflection support
-Infinite System
-Distance Blended Normals
-Configurable Sets of Panning Normals (Small, Medium, Far)
-Heightmap-based Seafoam & Foam Wave Caps (Thanks 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/⌠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 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 is the first of a series of upcoming skydome changes.
update is the high accuracy sun & moon positioning, based on the input latitude, longitude, UTC offset, and local time. The calculations for 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 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), hours in a day (23), 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/do not have any effect.
Finally we have the Debug HUD, 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 data is to use 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:
SUN
- 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](http://www.pveducation.org/pvcdrom/properties-of-sunlight/suns-position) (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](Declination Angle | PVEducation): The earthâs axial tilt for the given date/time vs the sun. varies from -23.4397 (northern hemisphere winter) to +23.4397 (northern hemisphere summer).
- Altitude Angle](Elevation Angle | PVEducation): 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 value to work in UE4 coordinates we need to subtract 180 from the result, is why the value differs in the actual rotatorâ pitch value.
- Azimuth Angle](Azimuth Angle | PVEducation): The horizontal compass direction of the sun. At solar noon 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:
http://www.pveducation.org/pvcdrom/pâŚ/suns-position
http://www.stjarnhimlen.se/comp/tutorial.html#5
http://www.powerfromthesun.net/Book/âŚchapter03.html
MOON
- 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](Ecliptic coordinate system - Wikipedia): The longitude location of the moon on the celestial sphere.
- Ecliptic Latitude](Ecliptic coordinate system - Wikipedia): 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, 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. 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:
http://aa.quae.nl/en/reken/hemelpositie.html
http://www.stjarnhimlen.se/comp/tutorial.html#7
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 ). Highly recommend watching it to get a good idea how works:
watch?v=IJhgZBn-LHg
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. 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 here