The Environment Project has officially released as of 06/12/2020!!!
This is the separation and improvement of the Ocean Project into various plugins!
PLEASE DO NOT ASK FOR HELP ON THIS THREAD. Go to the discord. Read the #FAQ first.
I’m trying to keep this thread clean, all common issues are in the #FAQ, and as new issues arise, they get added to the #FAQ
Welcome to the community created Environment Project! (Ocean Project)
The point of this project is create a nearly drop in, truly dynamic, environment that covers all the essentials for any game developer… 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 which are realistically setup to account for everything such as time/data/lat/long/timezone ect.
Github: GitHub - UE4-OceanProject/OceanProject: Environment Plugin Project (Ocean Simulation, Sky Simulation, Buoyancy, Time, Fish plugins for Unreal Engine 4) (Now points to the Environment Project)
https://forums.unrealengine.com/comm…n-water-shader will provide an insight to the history of this project.
Credits at bottom of post.
This is copy paste from original thread, some of it may be outdated, but still lots of useful information:
New Skydome Features
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](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](http://www.pveducation.org/pvcdrom/properties-of-sunlight/declination-angle): 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](http://www.pveducation.org/pvcdrom/properties-of-sunlight/elevation-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](http://www.pveducation.org/pvcdrom/properties-of-sunlight/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](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, 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.
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.
-Code for Buoyancy
-Infinite Ocean System
-Screen Space Reflections (SSR)
-Planar Reflection support
-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
- Current project owner/manager
- IWYU compliance fixes
- Conversion into the Environment Plugin Project (Seperation of Ocean Project into individual plugins, cleanup, de-bloating)
- Physically correct sun/moon position code.
- Several fixes and improvements to the sky system (eclipses, clouds hiding sun/moon, sun/moon/clouds hiding stars)
- Various tutorials
-Additions to the SkyDome
Burnrate (Justin Beales) :
- Created with Misc. Games and Intelligent Procedure for:
- Fishing: Barents Sea
-Fish flocking AI and a variety of fish:
Project maintainers (past and current):
- Tons of code/project cleanup, conversion of ocean to cpp
- Tons of customization settings, conversion of ocean to cpp
- New buoyancy system (In progress)
- Fixed coding conventions on Fish System, fixed GetDayOfYear crash, moved underwaterbp to c++ for 2ms speed up (not imported yet)
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 - https://forums.unrealengine.com/comm…hysical-ocean=
JBaldwin - https://forums.unrealengine.com/comm…review-Thread=
berna - https://forums.unrealengine.com/comm…le-quot-ocean=
ufna - https://forums.unrealengine.com/deve…hlight=vaocean
Ehamloptiran - https://forums.unrealengine.com/deve…urface-Plugin=
KhenaB - (dead link) https://forums.unrealengine.com/comm…ht=ocean+storm
gregdumb - https://forums.unrealengine.com/comm…light=gregdumb
and many others.