[Community Project] WIP Weather & Ocean Water Shader

Oh wow I feel silly haha thanks TK, that fixed the problem right up. I’ll be sure to try and read up a little more next time :smiley:

Thank you, everyone who has contributed to this brilliant project.

I apologize for a rather dumb question, but I just can’t figure it out…

in the Bp_underwater blueprint, theres a material instance variable called “Wet lens mat inst”, however its default value is set to none. I don’t find any “set” nodes where it gets set anywhere. Yet the effect appears when I play and go underwater.

Same with the “MainPPVolumeRef” variable in the same blueprint.

Can anyone give me some tips on where the wet effect is being set?

I assume your using v the pp underwater Inst 2 since your getting the lense fx

Check level BP, BP_Ocean, and any post process blendables. It somewhere in there cant ermember exactly where ATM.

Edit: Gonna start playing around with CudaFFT and see if I cant get some cstdlib c++ code running with it included.

Beautiful. I must have been really tired last night, since after reopening the project today, I immediately found what I was looking for. I’m ashamed to say that it is indeed located inside the bp_underwater.

Regarding the underwater fog, can it be used without c++? Through blueprints only, that is.

Well Nvidias CudaFFT is well commented and I beleive I could port their example ocean sample to unreal but WaveWorks uses KissFFT gonna look into that and see if its not Nvidia specific.

Really wanna make some storms without the performance hit.

Has anyone tried making a boat controllable while still controlling a character? When I drop into my boat (not currently masked with the ocean mask) and sit in the pressure hull and then hit “Ahead flank power” the boat rockets forward while my character stands still until the aft end bulkhead hits my character and drags it along. Is this because im in the water and not standing on a mesh (well im on both technially)

basically if I create decks will my character inherit rotation and locaton of a boat pawn being controlled through the player controller. I havnt run into this issue yet because I never got to interiors.

KissFFT is already used in the engine, actually (don’t know if you knew or not).

It works on the tall ship in the example map.

So I have retargeted the mixamo swim anims to the UE4 guy and they work fairly well but I’m not 100% sure if it’s allowed to share the mixamo animations :p, I mean you can technically get them for free from their site but I believe only the first 10 animations you download are free, should I just go for it? lol.

There are still problems with the character buoyancy of course like jumping out of the water volume which I don’t think they can be solved properly without a custom CharacterMovementComponent but I don’t want to spend time on this right now.

The fog I suppose yes but the wet lens effect toggle relies on the displacement readback which is via C++.

The performance is actually better for me in the storm map :stuck_out_tongue: what is causing the performance hit in your case?
Try disabling the buoyancy an see if that helps… you might be cpu bound in which case you could try simulating less waves (like only the large/important ones) for the buoyancy.

Implementing FFT is more difficult than you might think, you could make a cpu version relatively easily but you will not be able to have a large size FFT that way (maybe 64x64 or so) nor you will be able to easily pass to the material… the challenging part (at least for me) is making a proper GPU version which uses compute shader so that you can have larger and performant FFT and then pass the same data on the CPU as well for buoyancy.

About the character… I would try attaching the character to the boat/sub when you are not controlling the character, like you would do for a car.
It’s not easy to have the character flawlessly inherit the movement when a vehicle is so physics-based and fast moving (the character movement component is simply not programmed with something like that in mind).

I can animate the tpp_hero in blender to .fbx animations if needed maybe over the weekend. Im getting tired of lineing up all the parts for my first submarine interior perfectly so I’m starting some material and particle tutorials but I could do a swim anim and animBP if needed… my research on ffts are I dont know enough of even std C++ or math to understand them yet,

Is there a way to go from a calm one-wave-set ocean to the stormy style, and back?

Awesome work TK, I tested the new build out last night and it’s epic.

As far as the animations go, I think it’s probably fine if you just give us the .uasset versions and not the source FBXs. Sort of inconvient-ish but I think that would comply with the license, since you’d be packaging those exact cooked animations in a regular game. If anyone needs the source FBXs they are there @ Mixamo of course.

Obviously I could be wrong but I suspect that’s the case.

I beleive thats the goal with the beaufort scale something like float seaScale += seascale; if seascale == 2 {set enum beaufort = ‘Mild Chop’} kinda thing.

Has there been any recent improvements to the skydome? I am still having issues with the skylight capture during night in our open world project. With a value of 1 during the day, everything looks great. Once night hits and the skylight captures, shadows get pitch black. I am not a proficent blueprinter, so I have no idea how to add or fix this.

Hello! Please tell me, where is the parameter that is responsible for the angular water resistance? I can not find … Just wanted to weaken it in some cases, for some models. Because sometimes it felt that the boat moves as if on rails. And in fact, the ship must drift a little bit in the corners. Thank you in advance!



This is on my list of things I need to blueprint since there is no built in setupm that works well. Wil keep you informed.

Good job TK, looks great. I hope you release the Anims.

And please reconsider, a custom CharacterMovementComponent is the perfect fit for the project. Phoenyx Anim Pack 3, when released on the Marketplace, will include a “freestyle” swim anim. So it is important to fix the buoyancy, so that when in freestyle, the character stays on the surface, and when surface treading, it bobs up and down with the waterline staying at the character’s chest level, and when underwater the character is stationary in an underwater idle anim or in the breasts stroking anim. Your animation shows how awesome this looks. And for my project, I move from 3rd to 1st person with a push of the right controller stick. 1st person, bobbing up and down in the ocean, that would really be an immersive experience.

I think a state machine and blend spaces could take care of issues associated with waking into water, diving, jumping in and out.

But freestyle surface swimming like we see in Subnautica, and character smoothly bobbing at the surface with waves without popping out of the water, is something beyond my ability. And there is no solution for this on the Marketplace.

Can you describe functionality you want to see in this custom component? For example, I once made a simple custom character movement component with several new states (in water, swim, swim underwater, etc.). To check when you need to switch from in water to swim state, I did a simple ray cast from the middle of an actor and if it hits water then switch to swim mode occurs. Similar thing was done to check when it is required to switch from “swim” to “in water”. Also made some modifications in velocity calculations, etc. So maybe I can use that one as a foundation for something more complex which can be then integrated into this project. But as I said I’d like to see a list of requirements for such component.

Hello Peter,

TK and others might be better at providing an answer to this but … The functionality I am looking for is: Underwater breast stroke, Underwater tread water, On Surface freestyle swim, On Surface tread water, with On Surface buoyancy so that the character realistically bobs up and down on the surface, while idle or free style swimming, with the height of the waves staying around the character’s chest. Along with this, I need the ability to switch between 1st person and 3rd person as I can do on dry land. I use a 3rd person BP, but for 1st person I attach a second camera to the root of the 3rd person character, so it does not bob around. With the push of the right thumb stick I can switch between 3rd and 1st. But when the character goes prone in water the 1st person camera drops behind the character like the 3rd person. Have you seen the game Subnautica? That has first person free style swimming on the water surface, and breast stroke underwater, with full person shadows. So someone has figured out how to do this in their engine.

Other issues to consider are how to handle the character standing on the shore line, waist deep in water, without going into swim, and walking into water with intention of swimming, diving, and climbing or jumping out of water into a boat. This shader does have an Underwater Post Process Volume and an in water detection, but the goal would be to have blended, smooth anims of all of these states, in 1st and 3rd person, with no camera glitches, or character bounding out of the water up to its ankles when a wave comes by. The character needs to smoothly bob up and down with the swells, with the waterline staying at its chest like real life. Then the buoyancy need to go to neutral when the character dives down into the water.

Now that we have great ocean water, we need to sell it with equally great character movement in the water.

Forgot to mention, Alex is back working on his swash/backwash shoreline waves. I wrote him and asked if he would consider bringing his work to this project. His shoreline shader is the best I have seen anywhere. Please check it out: and

I really think one of the senior members or EPIC need to contact him and bring him on board with this project.


hi, sorry for noob question/probably already mentioned somewhere, tough tried read the topic.
can I somehow see water waving reflection on metallic surfaces?
I have reflection capture sphere added, but dont see any difference :frowning:


I see reflectivity unless its shadowing thats just coincidental. Make the material base color grey roughness 0 and mettalic 1 and nothing else and you ncould even plug a mettalic node into the base color string and it should reflect like a mirror.