Skip to content

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

Merged
merged 3 commits into from
Apr 27, 2025

Conversation

cmhhelgeson
Copy link
Contributor

Related PR: #30695

Description

Adjusts webgpu_compute_water to act like new webgl_gpgpu_water.

image

@mrdoob mrdoob added this to the r177 milestone Apr 24, 2025
@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 24, 2025

Do you mind resolving the CodeQL issues?

@sunag
Copy link
Collaborator

sunag commented Apr 25, 2025

The water effect is really cool, but the duck physics are questionable

@WestLangley
Copy link
Collaborator

Temporary live link:

https://raw.githack.com/cmhhelgeson/three.js/cmh/update_gpu_water/examples/webgpu_compute_water.html

@sunag sunag marked this pull request as ready for review April 27, 2025 17:55
@sunag
Copy link
Collaborator

sunag commented Apr 27, 2025

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.

@sunag sunag merged commit 5cadd4f into mrdoob:dev Apr 27, 2025
11 checks passed
@cmhhelgeson
Copy link
Contributor Author

cmhhelgeson commented Apr 27, 2025

Apologies for not getting back to this sooner, thought I had put it as a draft.

@Spiri0
Copy link
Contributor

Spiri0 commented Apr 27, 2025

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.

RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
* init branch

* fix duck material

* bounds checks fixed still something off with velocity on height change
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
* init branch

* fix duck material

* bounds checks fixed still something off with velocity on height change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants