Skip to content

Conversation

holtsetio
Copy link
Contributor

@holtsetio holtsetio commented May 22, 2025

Description

This adds an interactive MLS-MPM based particle fluid simulation as a compute shader heavy example for TSL, using atomics, nested loops, structs, etc. Unfortunately it will only work in WebGPU, not with the WebGL Fallback.

Possible improvements:

  • Add a more interesting environment
  • Add screen space fluid rendering to achieve the look of water. However that is really complicated and I feel like this example is already complex enough.
  • Disable AO by default or lower the default number of particles to make it run smoother on mobile devices.

live example

@sunag sunag added this to the r177 milestone May 23, 2025
@sunag sunag merged commit f714027 into mrdoob:dev May 23, 2025
11 checks passed
@WestLangley
Copy link
Collaborator

The ambient occlusion post-processing seems to be a performance killer when zoomed-in. It also makes little visual difference.

How would you feel about removing it?

@holtsetio
Copy link
Contributor Author

__

The ambient occlusion post-processing seems to be a performance killer when zoomed-in. It also makes little visual difference.

How would you feel about removing it?

Thought the same already, especially on mobile it's a performance killer. But it helps giving some depth to the visuals. Maybe not remove it, but just disable it by default?

@WestLangley
Copy link
Collaborator

I would avoid including a feature that diminishes performance for marginal benefit. So my preference would be to remove it.

I'd hate for something to detract from this excellent demo.

@Spiri0
Copy link
Contributor

Spiri0 commented May 26, 2025

@holtsetio This would be very suitable to implement spray in my WebGPU Ocean repo.

RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
* begin work on webgpu_compute_particles_fluid

* add mouse interaction

* cleanup, add rounded box constraints, add ao, improve stability

* removing `.setPBO()`

* Update webgpu_compute_particles_fluid.html

Fix formatting.

---------
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
* begin work on webgpu_compute_particles_fluid

* add mouse interaction

* cleanup, add rounded box constraints, add ao, improve stability

* removing `.setPBO()`

* Update webgpu_compute_particles_fluid.html

Fix formatting.

---------
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.

5 participants