FFT Ocean shader #8301
Closed
Lexpartizan
started this conversation in
3D
Replies: 1 comment 4 replies
-
This is something that belongs in a plugin, not as part of the engine |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The ocean is often needed by game developers. And at the moment, the method of modeling waves using the Fast Fourier Transform is the most optimal. A lot of people could use this.
But I failed with such an implementation, despite repeated attempts to return to it with fresh strength. I'm not qualified enough for this.
I've found many implementations, but I'm not competent enough to port them to Godot. Perhaps someone else will do it better.
There are several implementations on shadertoy. But the problem is that after some updates, some of them stopped showing the results of their work or some buffers.
Let's start in order of usefulness.
https://www.shadertoy.com/view/DtjBzt
Here is a perfect example of the more advanced oceanic spectrum (but more complex). The waves look much better with it when the wind is strong. In addition, parameters such as normals, choppines and jacobian_factor (for foam) are calculated. But here it is not Fast, but Discrete Fourier Transform that is used, so on the full screen we get only a couple of frames for the 1050 video card. And in the default window there are only 40.
https://www.shadertoy.com/view/tdSfWG
This shader has a much simpler ocean spectrum and much higher performance. However, there are problems with the wind direction and overall appearance. Also, displaying screen buffers doesn't really help. I easily get the first buffer with a picture of the spectrum and noise and easily repeat it myself. But then I’m in a stupor.
https://www.shadertoy.com/view/wt2yRd
https://www.shadertoy.com/view/3sf3Dj
These are examples of how after updates the buffers no longer work as expected. There is no result. Although six months ago the generated heightmaps were visible there.
Useful documentation
https://www.youtube.com/watch?v=kGEqaX4Y4bQ
https://tore.tuhh.de/entities/publication/1cd390d3-732b-41c1-aa2b-07b71a64edd2/files
https://arm-software.github.io/opengl-es-sdk-for-android/ocean_f_f_t.html
And the most important thing. Such a project already exists as an addon.
https://github.com/tessarakkt/godot4-oceanfft
However, firstly, it crashes on startup for me. And secondly, it is very difficult to figure it out. There are no viewports or a built scene with them to understand the stages and interdependence. There, the code uses compute GLSL shaders with conversion. It's too difficult to use for education.
I want to apologize in advance for such an arrogant desire, but this is just a suggestion in the VFX section. VFX and Techart wishlist
#StandWithUkraine!
Beta Was this translation helpful? Give feedback.
All reactions