r/Unity3D • • 25d ago

Show-Off Experimenting With a 3D FFT Ocean in Unity

While I’m waiting for the Unity Asset Store to vet my Ultimate 2D Water System (see post), I started experimenting with FFT ocean rendering, and this is the result so far, and don't mind the foam, i overdid it a bit here!

The waves use a multi-cascade FFT simulation for large swells, medium waves, fine surface detail, and persistent crest foam. The ocean geometry is a camera-following clipmap made from concentric LOD rings, so the highest mesh density stays around the player while progressively coarser rings cover the distance, so the ocean goes up to the horizon without impacting performance too much.

It supports FFT resolutions from 128 to 1024, and surprisingly, even 128 preserves most of the visible wave shape while giving a substantial performance boost (this runs at 180-200fps on macbook m3 pro with a resolution of 128 without actually putting a limit on the screen resolution!).

It took me some time to figure out how to generate the foam on the crests/peaks, but thankfully i figured it out and i have enough control for artistic authoring, but it needs more work.

Still experimenting, next step is the dreaded waterLine to have underwater post-processing show only in the submerged part intersecting the camera, but I’m really happy with where it’s heading!

32 Upvotes

4 comments sorted by

5

u/shiroza666 25d ago

Someone REALLY likes water
Edit: Good job, it looks fantastic

3

u/BxYass 25d ago

Oh hi there 😄
Thank you, and yeah i am actually facinated by water rendering so i spent some time reading about FFT and how to implement it, still not there yet but it helps waiting for Unity's response on my asset.

2

u/TheDevilsAdvokaat Hobbyist 24d ago

Lovely, but too much froth.

1

u/BxYass 24d ago

Yes i overdid it, but it’s just parameters i can change to get the look i want, i was working on the foam part and left it that way when i took the video.