Download

[Community Project] WIP Weather & Ocean Water Shader

Hi there,

When moving to a new project, make sure you follow these steps:

-Migrate “BP_Ocean” and “BP_Sky” (or BP_Skydome if you are not yet using the update that was added last night)
-Open Windows Explorer and navigate you your ProjectName directory, if it does not already have a “Plugins” folder, create one and copy the OceanPlugin folder from the download to this folder
-Open your project and place both of these actors into your scene
-For the skydome make sure to set the “Sun Light Source” in the details panel to a Directional Light in your scene, and make sure the light is set to Movable
-To get proper reflections I highly recommend setting the “SkyLight” in the details panel to a SkyLiught actor in your world, and make sure the Skylight actor is set to Movable
-In the BP_Ocean settings ensure you are using an ocean material that has SSR enabled, there are 6 to choose from and are marked as either SSR or No SSR

That should be all you need to do, please let me know if you run into any issues, it’s been a while since I have tried migrating (but probably should try again, I’ll get on that :stuck_out_tongue: )

Ahh yes, KhenaB’s VR ocean sim. He did an awesome job with his shader to get that effect, hope to see more of it soon, here’s the link to his thread if you are interested:
https://forums.unrealengine.com/showthread.php?47316-SubSide-Dev-progress

As far as the technique goes, it is totally possible to do, there is a thread he made while working on that exact scene here:
https://forums.unrealengine.com/showthread.php?54733-Is-this-possible

I have it bookmarked as something I want to add in when I can, I really don’t like the current setup where your either underwater or above, so it’s high on my to do list.

If you happen to get anything working before I do I would love to hear about it! I’m busy working on the weather systems currently, but will try and get to it when I can. :slight_smile:

Thanks a bunch Dotcam, will do if that indeed happens to be the case. :slight_smile:

Great! Thanks for the feedback, if you (or anyone else) find any errors in the calculations let me know! :slight_smile:

I will say I have already found a couple issues, not so much errors, relating to the functions that convert from TimeDate to Julian Day (JD200) calculations. The further from the JD2000 epoch you go, the worse it gets.

Second issue is the moon is (potentially) rotating off-axis, need to do more debugging vs actual data. It’s rotating at the right speed but the Rise/Set locations seem to be off a bit.

Alright, back to it. :slight_smile:

I believe I’ve done everything you’ve said (since I started from a blank level several times, both in your project and mine), but still have issues (only when migrating, ofc.)
I’ll post the screenshots tommorow, some strange stuff going on. I do hope it’s just me being sloppy… :slight_smile:

Well in that case I will try it on my end this afternoon, it has been a while so there is probably something I’m missing. There have been a lot of changes since I last attempted it, so it wouldn’t surprise me. :slight_smile:

Here are the screens. To me it looks almost like the BP got its axes mixed up, like this visual transition should happen along the vertical axis and not like this. I’m primarily an artist, not a coder, so sorry for the primitive language! :slight_smile:
Obviously this is the no-gerstner-ssr version of the ocean.

Starting from scratch in the OceanProject… umm… project. :slight_smile: [sun low, for exaggerated effect]
b84e9afbaab0042443e4545918537936d2a558e8.jpeg

Following same steps, but in another project (just a different time of day, sry)
Untitled-3.jpg

The reflections are not all gone, however they happen only at the one “side” of the world (let’s call it south here lol)
Untitled-2.jpg

Are you using the no gerstner version with SSR or without? SSR is going to provide the majority of the reflections, so that is the first thing to check.

Have you scaled anything up at all? The second image looks like SSS (SubSurface Scattering, the turquoise color) has been stretched quite a bit, but it’s hard to tell from that angle.

It is really hard to tell from those images what is going on, could you please take a screenshot of the settings you are using for the ocean? I tested it out earlier and was not able to reproduce this, so I’m not entirely sure what is going on.

And for confirmation, is your skydome blueprint named “BP_SkySphere”, “BP_Skydome”, or “BP_Sky”? Could you also select it in the scene and post a screenshot showing the details panel (specifically the Sun and Atmosphere sections).

EDIT: Also remove the reflection capture for now, it does not provide proper reflections when using dynamic lighting. 4.9 will introduce a new feature for that, but for now it does not really help. Make sure your lights are all set to movealbe too.

does this work on mac? Im just getting a speckled plane when opening the project in 4.8.3 - there are errors in the material that say sm4 shader exceeds the limit of 16 - not sure if that is relevant.

Thanks for all the hard work

edit* ahh, nevermind, saw the issue addressed in an earlier post

As of right now, it only works (properly) on DirectX 11 or greater. The reason for that is DX11 allows for more than 16 Texture Samplers being used through shared sampling, OpenGL has a limit of 16.

Due to the engine’s requirements for a translucent surface with dynamic lighting, the engine uses 10 samplers without me even adding a single texture.

I’m doing some general housekeeping on the project right now, making a OpenGL compatible version has been something I have been meaning to do for a while. I’ll give it a try later today and see what it will require, I can’t guarantee it will have all of the features the DX11 one has, but should be able to get pretty close.

Wow, thats really nice of you. I really appreciate the extra effort. Thanks

Hey DotCam I tried setting up a new skydome with your new time setup, i used latitude/longitude of midway island with the proper -11 utc timezone setting but the moon is always in the sky no matter the time of day.

Ideas? Known?

Hey Nsomnia, sent you a message on skype as well, but check to make sure the lat is between -90 and 90, and long is between -180 to 180 (some maps show 0-360deg, if its greater than 180 subtract 360).

Using the values LAT = 28 LONG = -177 has the moon setting at 11am on March 3rd 2015 in my project. It’s possible I have fixed a bug since uploading it to Github, so please let me know if those values provide the wrong results.

There will be no more mesh moon in the next version, I am removing it and using a projected image instead so the atmosphere is in front of the moon, which currently causes it to look bad in the daytime. It also looks much more realistic. :slight_smile:

I tried the following cordinates: Lat 37 long 14 UTC + 1, we see also that the moon passes by the sun at 16 h of day 30 month 8 2015

it’s normal?

No it is not, sorry about that. It has been fixed on my end, and I will update the GitHub build shortly.

Quick note:

Ver 4.9 has been released, and TK-Master was able to create a new branch for ver 4.9 on GitHub (available here). There were a few breaking changes that needed to be fixed, Epic had moved some code around so he had to re-write a couple of the classes in code. Therefore upgrading your project from 4.8 will not work without making some changes.

If you need to upgrade your 4.8 project, please see my post below.

Thanks!

If you only need the updated plugin for 4.9 (for those who are using their own project), you can download the new plugin below. So long as you haven’t made any custom code changes to the plugin itself (in C++), this should be all you need to do to get up and running in 4.9. If you have made changes to the code, you will need to manually update the changed code files in your project with the changes on GitHub.

If you have not edited the Plugin, follow these steps:

Download the new plugin here:
https://drive.google.com/file/d/0B3u_RPl4K60iclZUZDJPSlN4UlU/view?usp=sharing

Open your ProjectName\Plugins folder in Windows Explorer and delete (or remove) the “OceanPlugin” folder that is currently in the Plugins folder, then un-zip the file you downloaded into the Plugins folder.

If you have edited the plugin, please PM me if you have any trouble getting up and running.

For everyone who wants all of the sample content and the latest plugin, simply download the 4.9 build available here:
https://github.com/UE4-OceanProject/OceanProject/tree/4.9

Thanks!

download it, and project when i open it - crashed. already trying many times.

Make sure you open it from 4.9, don’t double click your project file:

Open the Launcher and launch 4.9, then in the dialog that pops up click browse and locate your project.

Can you confirm this is the way you are trying to open your project? Make sure you always choose “Convert a Copy” so you can roll back if there are any issues.

I,m following all the instructions but “UE4Editor-OceanProject.dll” isn’t compatible with 4.9.

“UE4Editor-OceanPlugin.dll” works fine but “UE4Editor-OceanProject.dll” give the problem of “built with different engine version”.