I have updated my webpage to include this page that showcases the updated LAB (Li-Albert-Bouny) iFFT ocean wave generator. I have packaged the wave generator as a module that you can download and, hopefully, use in your three.js programs. Instructions are given on the page.
Ocean waves from the movie “Dunkirk” compared to waves created by this module.
NOTES
I do not yet use node.js (or similar software), so let me know if I need to make any changes to the module to make it compatible with those programs.
Note that the zip file includes a sample program that contains the module internally so that you can run the program locally and experiment with making changes and improvements to the module and settings.
GRDMAP and GRDWTR MODULES
I have now added a new page from which you can download the version of the GrdMap module (GrdWtr) that works with the Ocean module to provide you with a moving map of animated waves that extends to the horizon… As above, the zip file includes a sample program that contains both modules internally, so you can run the program locally and experiment with changes and improvements.
UPDATE 5/31/2023
The “GrdMap and GrdWtr” page listed above has been updated. The GrdWtr module is now a simplified version of the GrdMap module designed to work with the Oceans module. The GrdMap module allows you to add and modify textures and materials. This requires the addition of a couple of functions to your main program. Both modules fix the “wrapping” problem discussed and solved below. The Oceans module has not been changed.
NODES VERSION (4/6/2024)
I have now created a Nodes version, which I will add to the webpages. The material definition also includes a diffuseMap and roughnessMap which adds some variation to the appearance of the ocean. The Nodes version also appears to do a better job of displaying the waves at long distances, especially at low level.
WEBGPU VERSION
Since, after r165, NodeMaterials no longer work with WebGL2, I was finally “forced” to create a WebGPU version of the Wave Generator. This is essentially a scaled-down version of a WebGPU Wave Generator created by Attila Schroeder (which uses a butterfly texture). Since this is for a flight simulation, I have focused on trying to make the water look better from both high and low altitudes. I have moved my files to my GitHub Repository. The new modules are GrdWtr4 and Ocean4 in the jsm directory. Here is a simple demo. (You may have to hit reload to get the SkyBox to display.)
WEBGPU VERSION r167 (8/15/2024)
And, almost as soon as I got the WebGPU version working, r167 changed how WebGPU is implemented in three.js. The new versions of the modules are GrdWtr4a and Ocean4a. Here is a simple demo. I have now updated the various flight demos to use these modules (designated with ocean_gpu)… You can view these demos on GitHub Repository. The ReadMe explains how to run the programs and contains a link to one of the programs.