tessarakkt / godot4-oceanfft Goto Github PK
View Code? Open in Web Editor NEWTessendorf FFT based ocean waves and buoyancy in Godot 4 using compute shaders
License: MIT License
Tessendorf FFT based ocean waves and buoyancy in Godot 4 using compute shaders
License: MIT License
I think it could be useful to make the wave generation parameters available to other shaders to use because it would allow the splash particles to move in the direction of the wind and be affected by the wind speed. I could also see higher choppiness/windspeed potentially affecting the amount of bubbles that appear near the surface.
If we can describe how we'd like that to be implemented here, I'd gladly do the legwork of implementing it.
The underwater particle spawning appears to mess up when the spawning sphere is not completely submerged. We might be able to stop this from happening if we stop spawning new underwater particles when the sphere is intersected. This would also prevent particles from spawning nearby objects but I would think that could be solved easily by another spawner.
Great work! But there are some design decisions which hamper end-user usability, notably:
I've made a commit in a fork that I can PR which I think nicely solves this for BuoyancyBody3D and BuoyancyProbe3D, as well as one that removes the hardcoded paths in MotorVessel3D (just opting for exported node paths). (https://github.com/Tattomoosa/godot4-oceanfft)
This has the added benefit that probes added during runtime will work without adding them manually as a separate step. (And it just occurred to me that they could easily remove themselves when they exit the tree, so I'll make a commit for that as well)
Poking at this but having some problems getting QuadTrees to play nice as a tool script, still looking at that.
This is pretty easy to resolve and seems worth doing to allow for autonomous vessels, but considering going a bit further and supporting multiple propellers while I'm at it. Apparently twin rudders is a thing too, TIL.
This has some other considerations:
It seems to me the ideal end-user experience would be to add a single node that just works, but I'm not really sure that's reasonable yet. Happy to keep poking and implement changes myself but wanted to start a conversation and get your thoughts before I do too much work -- would definitely prefer to contribute here than maintain a fork.
Originally posted by Torivon September 19, 2023
When running the example scene (In Godot 4.1.1.stable) , the camera is always at the corner of the ocean. Wherever I move the camera, there is ocean in the positive x/positive z direction, with nothingness in the 3 other quadrants. This seems to be a visual issue only as buoyant objects properly respond to the waves that ought to be present. As far as I can tell, the camera should always be in the center of the visible ocean.
I am relatively new to both shaders and Godot, and have not been able to figure out where the disconnect is.
If the curvature of the planetary surface is greater than 0, then when moving away from the center the ship sinks under the underlying surface.
When closing the game window via the windows close button, the window will freeze on the last frame and stop responding.
Confirmed to happen on Godot 4 beta 12, previous betas likely affected as well.
Usage of a sampler2d array uniform in the visual shader. This is acknowledged by godotengine/godot#70527.
Return to the Godot editor window and use the stop button to stop the game process immediately.
A fix has been recently merged into Godot (pull request godotengine/godot#71346) and should be included in an upcoming beta release.
I used the clipmesh of Terrain3D as a replacement for the quadtree based mesh thast there currently. It works way better and I got it running in the editor even.
Thanks for the work. I have a question about the speed of the MotorRectangle. How can I increase its speed? Changing thrust_power_main does not help. Using Godot v4.2.2.rc1.official [c7fb0645a]
I do not know how to describe it properly, but on my sistem keys presented in readme file not working.
When switching in the demo to the boat mode and increasing wind speed and chopiness, the jitter is very visible. It seems to not come from the physics system, but the wave heights computed in the compute shader.
How can you change the height of the water surface generation? For example y = 150.
Hi,
Thank you very much for this work.
I noticed that the wind_uv_offset and wind_angle transfered from Ocean3d to the shader contains both the rotation.
If we remove the wind_angle, the choosen rotation with the widget is applyed.
Thank you
I am working with a double precision build (Godot 4.2.3 mono). The example project runs, but the initial spectrum (and thus the waves) are not the same as in the single-precision build. Making the following 1-line change solves the issue:
In Ocean3D._pack_initial_spectrum_settings(), change the line that appends the wave vector to pass the wave vector components as 32-bit floats instead of a Vector2. The double precision build of Godot uses 64-bit Vector2, but it makes the correct conversion to 32-bit floats when appending the components to a PackedFloat32Array.
WAS:
settings_bytes.append_array(PackedVector2Array([wave_vector]).to_byte_array())
SHOULD BE:
settings_bytes.append_array(PackedFloat32Array([wave_vector.x, wave_vector.y]).to_byte_array())
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.