Download

[Community Project] WIP Weather & Ocean Water Shader

Have you all seen Bethesdas military sim stuff for oceans. Its what this project dreams (and I dream of creating off it one day) to be.

https://youtube.com/watch?v=6gPQ5xv54LU

A couple of really great articles about buoyancy simulation by one of the programmers for Just Cause 3:


@TK-Master - any chance you could release what you have on the underwater fog? What you showed is already better than what I have.

These are some really nice and detailed articles! thanks for the links n00854180t.
The first part is pretty much Nubtron’s BuoyantMesh system so perhaps it can be edited to use the force and damping algorithms from part 2 :slight_smile: if only I had this kind of article back in the UDK ways when I was developing my buoyant system and struggling to make it stable :p:p

Edit: wait that’s actually the article Nubtron has based his system on haha I don’t know why I thought it was a newer article (I guess because Just Cause 3 was released recently).

I will definitely share the underwater fog, landscape modulation etc. eventually… the problem once again is time :stuck_out_tongue: I need to find some time to polish things and expose all the necessary parameters (right now it’s a gigantic mess with hardcoded parameters and only works in the demo level so unfortunately it’s really not in a “shareable” state atm at all).

Btw there has been a bit of progress with the underwater masking, it masks it somewhat decently (still far far from perfect but you need to look closely to find masking errors) but the main problem is that I had to use the gerstner wave calculations twice(!) in the post process material which ends up hurting performance (it’s at least -10 fps in my machine) so optimization (or a better method altogether actually) is still needed but it’s something :rolleyes: it could be a high-end graphics option I guess.

Anyways! in the meantime, here are some juicy screens just for you guys :wink:
http://www.mediafire.com/convkey/c49b/zr2avynw0q4n28vzg.jpg?size_id=5

http://www.mediafire.com/convkey/d988/p5dqrvvzwa7b8a4zg.jpg?size_id=3http://www.mediafire.com/convkey/1058/jlzy5fgp7nym55ezg.jpg?size_id=3http://www.mediafire.com/convkey/89a7/ey77bcb3kqzv26azg.jpg?size_id=3

It’s a quick scene I put together using a few marketplace assets (Ultra Dynamic Sky, Pirates Island etc.) just to see how far I could push the visuals. It took some tweaking but I’m happy with the results overall.
Getting just right cubemap captures for the skylight can make a huge huge difference, I’m actually working on a system that blends multiple captures over time (for example you can use 24 cubemaps, one per hour) so we can have seamless day-night cycles without any hitches (since it’s all pre-captured).

I should mention that I have slightly cleaned-up/blurred the reflections in photoshop in some of the screens since the artifacts from the ssr (I’m sure we all have seen those) are a bit too distracting :stuck_out_tongue:


If someone from Epic is reading this… please! do something about the reflections! we desperately need planar reflections… screen space reflections are just not good enough for something like this especially not in game when you have control over the camera… in my opinion the lack of decent reflections in UE4 is the biggest rendering issue when it comes to water.

Derp, didn’t realize this, though Nubtron’s solution did look awfully familiar! Hah

Dang, -10 fps is too big a hit for my purposes (VR). I’ll probably have to just disable the Gerstner wave lookups.

Looks amazing! Can’t wait for the release with your fog and terrain modulation :slight_smile: Epic work man.

Is that coastline procedurally generated? If so that would solve my problem of having ports that need a coastline and not having to create 500-5000 sub levels of landscape sculpted coastlines for ports that then go to the origin rebasing ocean level. I’m starting to take interest in getting my submarine simulator back up now that I know so much more about UE4 and finish my Java class end of the month then I’ll have all the time in the world to dedicate to underwater work.

Yeah it definitely is a big hit for a post process, VR or no VR :stuck_out_tongue:

But I have a cheap method to do this by having a small PP volume with blend radius follow the player camera and smoothly “fade in” the underwater fog when the camera goes underwater (so we only need to run the gerstner lookup in blueprint, which has no cost).
Obviously it won’t look as good with that method but at least it’s cheap :stuck_out_tongue: Also you could do it GTA 5 style (snap the camera underwater) although I have not yet seen how they handle it in first person mode.

I wonder, has any game ever done this the proper way? Every game that I have seen tries to avoid this by either having flat water or doing some kind of camera snap or fading.

Oh right what happened with your sub sim btw? It’s definitely a game I would play if done right :wink: not many of its kind either.

There is nothing special going with the coastline (apart from the heightmap modulation, which I mentioned in previous page) it’s the same depthfade foam that the shader has (I adjusted some parameters of course).

If you feel like experimenting… the heightmap modulation function looks like this:
http://www.mediafire.com/convkey/10b7/cll8hnov7go2lm6zg.jpg?size_id=5
You should multiply the Displacement Alpha with whatever goes to World Displacement input.
The commented variables need to be set based on your landscape (location, scale, (texture) size, and the heightmap texture), notice that there is no rotation variable (apparently I suck at rotational math) :stuck_out_tongue: which means your landscape should have 0 rotation.
The heightmap texture can be exported from the engine as png if you have sculpted it by hand, then import it and set the texture compression to HDR to take advantage of the heightmap’s 16bit.

All of that will be optimized and have exposed blueprint parameters eventually (sometime before 2017 hopefully :D:p).

Did you get in contact with what was his username that forked the github repo and made some great code changes?

I’m really Really thinking about putting time in development of the subsim again and now that I’ve learnt Java at a college/University level I’m sure I can pick up the UE4 API fairly fast and anything I come up with will be shared.

We need to get development going.

The only ones I know of that do it right are the Crysis and Far Cry games - they even do the half-camera above water case right.

The volume fade-in sounds perfect for my needs.

Hello everyone and thanks again for this amazing ocean :). I have a big problem and maybe one of you will be able to help me. I buy the Ultra Dynamic Sky and personnaly I really love it! Here the probleme: The ocean won’t update with the Sky and the Sun. So I see my real-time sun reflection and the reflection of the sun before I press play. I’ll show you some screenshot.

676a62656730e6e984ec9ecdbe749f9f37029136.jpeg

So If I start the game in Night mode, the ocean will always be dark and vice versa.

42dbe4f87f549bf3fff71a367e5a691628029672.jpeg

As we can see the light don’t work in real time with the ocean.

If someone here know how to fix this, it would be nice to share the solution.

Have a good day everyone!

That’s because of the skylight capture which is not updated in real time and there is no decent solution yet (you can force the skylight to recapture over time but it’s too expensive and will cause a noticeable hitch).

As I mention above, I’m working on a solution:

Thanks for the answer and sorry for the question!

Sorry for the late late late late late response. Haven’t check this thread in forever, or any of the UE4 threads for that matter. It’s been a while, but when I stopped development I was in the process of building FishNode’s. Basically you would have one fish manager in the scene, and a large sphere collider on yourself. When your sphere collider hits a FishNode, it spawns the fish type and number specified in the node. When the node moves more than a certain distance away from the sphere it should de-spawn back into a node. This idea was crafted so that you could have many more fish in the game world without having to compute their movement. It would also allow you to create schools of fish that migrate over long distances, or during weather events by moving only one object instead of up to 100’s, I’m not sure if I ever got around to the full implementation, but this is the grand idea. I believe when I stopped development I was having issues where if you hit the node, it left the sphere, and you hit the node again in rapid secession it would crash the level editor. Probably a pointer issue, where the spawn is pointing at a memory address that had just been erased. This would need to be solved for it to work correctly.

<3 you all,
Komo

P.S. Awesome image. Makes me happy to see the fish being used :3

I’m getting back into my project 2 weeks ahead of schedule and I have “Learning C++ Through Unreal Engine 4” on hold at the library (im 5th in line!) has anyone read it is it any good? So I may start coding ocean stuff soon as I start learning more about the C++ API using my uni Java experience.

Oh wow! Part 2 is out! I missed that! Can’t wait to give it a shot!

this really is a grate looking water, was playing around with it today going for that beach look. you cant see in the photos, but reflection that it gives off with the island look grate, and the way the water flows back from the beach, looks grate
Untitled.jpg
Untitled.01.jpg

That water looks realy professional and good.
I would almost say its the best water ive seen so far.

Hi. Can someone tell me the size of latest update?

I’m third in line at the library for the ue4 cpp book. Gonna try to modify the ocean mesh for boat wakes, bow waves and hurricanes. Any other ideas for cool things to try to code through cpp?

Hey, This project looks awesome.

Question: are there any copyrights the assets of this project. Can i use any of the included models for free?

Hello everyone!

I just want to say that I loved this project. It really is an incredible work!

Here is a screenshot from a personal game I’m working on using it.
warislands.jpg

Thank you DotCam for this awesome project!! :D:D