-
-
Notifications
You must be signed in to change notification settings - Fork 35.8k
Examples - WebGPU Compute Water Adjustment #30985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Do you mind resolving the CodeQL issues? |
The water effect is really cool, but the duck physics are questionable |
I made some revisions but I'm not able to upload them due to a permission error, I'm going to merge them up and do it in a separate PR. |
Apologies for not getting back to this sooner, thought I had put it as a draft. |
Real-world buoyancy simulation isn't relevant for this example. However, if it ever becomes necessary in a repo, I have a suitable solution. https://github.com/Spiri0/Threejs-WebGPU-Voxelizer The existing solutions read the water map back into the CPU at each interval and then use only a few points. This can be achieved way better with great physical precision using finite elements (voxels). I'm already doing this, and the ship's behavior on the water is very realistic. I don't have the buoyancy shader in my repo, but that's the most innocuous part. It's important to be able to divide the models into a countable number of defined volume elements. I accidentally made a mistake in the buoyancy shader, and then the ship sank bow-first because the bulkhead voxels were filling up. It would be interesting to use this to simulate the sinking of the Titanic. |
* init branch * fix duck material * bounds checks fixed still something off with velocity on height change
* init branch * fix duck material * bounds checks fixed still something off with velocity on height change
Related PR: #30695
Description
Adjusts webgpu_compute_water to act like new webgl_gpgpu_water.