Skip to content

Spiri0/Threejs-WebGPU-IFFT-Ocean

Repository files navigation

See it running live here

ocean_social

March 26, 2025: I've switched the IFFT system from storage textures to storage buffers. This saves a lot of compute steps and allows for the use of larger cascade textures. Now 3x512 instead of the previous 4x256. The performance has improved significantly.

For those interested in physically accurate buoyancy simulations, here's a voxelizer. With it, you can very precisely determine the volume of water displaced by a body of any shape, and thus the buoyancy force. I'll be working on this further. https://github.com/Spiri0/Threejs-WebGPU-Voxelizer

Threejs-WebGPU-IFFT-Ocean r174 This is a physically real ocean simulation using the jonswap ocean model and inverse fast fourier transformation. In src/ocean/ocean_constants.js you can use QT_OCEAN_MIN_CELL_RESOLUTION to have a higher resolution of the wireframe (even numbers only!).

Important: In order for the live server to work here on github, I had to deactivate the SharedArrayBuffers in the ocean worker and use ArrayBuffers for it. So if you download the repo I recommend using the SharedArrayBuffers. This is significantly more efficient.

I use a much more efficient and advanced techniques to create limitless landscapes. But this repo is pretty good to get into the topic of procedural geometry

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages