Community Tutorial: Ocean Simulation

I did this and it works but I made some kind of error and the ocean is moving way too fast, how would I fix this

Sorry, I don’t have 5.2 installed. If you post the compile errors I might be able to point you in the right direction.

It’s hard to say exactly what your error might be. I would start by looking at FX_OceanWater_SetPerFrame and FX_OceanWater_TimeStep scripts and make sure that the AnimationTime is being set correctly.

Does anyone know how to setup a buoyancy thing with this ocean?

Set up a waterbody ocean and the object with buoyancy as you normally would with the water plugin, then set the material of the water body ocean to the one we created for the niagara simulation, that should work but I haven’t tried it

1 Like

there weren’t any compile errors, I think it relates to the rendertargets as they are also too fast

You :crown:

I tried it but the ocean just pauses simulating for some reason…

Does anyone know how to apply underwater effects without using the water plugin?

Nvm that… This was overlooked by me(I forgot to add the niagara effect into the level) But I have a new problem… When I put the buoyancy thing to a cube and then play the level, It doesnt react to the waves. Anyways I can counter this? Its like its buoyant based on the plane without the displacement
@fortniterickroll

I also used to have that issue with the normal ocean material that the water plugin uses but it randomly stopped happening, idk how. Try getting the buoyancy to work with the normal material, then switch back to the simulated one. You could also use this guy’s tutorial: https://www.youtube.com/watch?v=ESXwS17Lya0

Is the buoyoncy system replicated @mjegen ? And also I wondered why you can’t just use asynchronous readback in the Ocean Particle System and do it like Ghrishlain Girardot?

Because it has limited to no practical application.
You do not want to be relying on Niagara for your game logic to run, even if limitations of readback are acceptable. And the limitations are latency and replication.

Ah alright thanks for the quick answer :slightly_smiling_face:! Is the cpu approach for the buoyoncy mentioned above replicated and much more important I wondered wether the Ocean is even synced between all clients or does every client generate a different Ocean?

That is entirely up to you decide when implementing.

I tried it, I think the buoyancy calculations are happening on gerstner waves for the water body when our ocean material is using a custom ftt simulation so the default buoyancy wouldn’t work

@mjegen , any idea why when I reduce cascade 4’s patch length from 2000 to 1000 in Niagara and in the CPU simulation the ocean surface computed by the CPU no longer matches what’s computed on the GPU?

Thanks!

2 Likes

jourverse was able to help me out with my question in a comment on this video.

I’ll quote it here:

For CPU, you need to adjust the PatchLength in OceanFFTData.h. For GPU, you need to set the user parameters of PatchLength in the Niagara system and adjust the material M_PreviewOceanWater’s CascadeSizes according to your PatchLength.

I was not doing the last step (modifying the material).

I like this tutorial. The ocean looks great. I am wondering if anyone knows a good way to make the water slightly transparent.

You can add a parameter to the opacity variable in the output node in the material.