Skip to content

Add FluidSim class for fluid simulation #31342

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

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

Conversation

bandinopla
Copy link

Made an object to apply fluid simulations based on a WEBGL code written originally by (2017) Pavel Dobryakov : (https://github.com/PavelDoGreat/WebGL-Fluid-Simulation/tree/master)

The object allows to quickly setup a surface that reacts to other "tracked" objects affecting the "fluid" and also it offers otter settings to change it's behaviour. The interface is very simple and allows to also maybe used not just as a fluid but as smoke? or clouds... It has many uses.

DEMO: https://threejs-fluid-simulation.vercel.app/

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 2, 2025

There has already been added a fluid simulation for WebGPURenderer: https://threejs.org/examples/?q=fluid#webgpu_compute_particles_fluid

There are also the following GPU water demons for both WebGLRenderer and WebGPURenderer:

https://threejs.org/examples/webgl_gpgpu_water
https://threejs.org/examples/webgpu_compute_water.html

I would rather suggest to improve one of the existing implementations than adding a third one.

Besides, adding such a component for WebGLRenderer means it relies on a lot of custom GLSL code. Please understand that it is not beneficial for the project to add more of this type of code because it is hard to maintain and must be converted to TSL in the future.

Thanks for your effort here but at the moment I think it's better if FluidSimulator is not added to the main repository but is maintained in an external one.

@bandinopla
Copy link
Author

this reminds me of: https://www.youtube.com/watch?v=W7rSYzbpA8k
Also if the word "fluid" makes noise, just call it "smoke simulator" and that argument you just did falls apart.
Anyway, no problem.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 2, 2025

It's an unrewarding task to tell developers when a PR is rejected but it is indispensable to keep an eye on the maintainability of a project. There is a so many third-party code that could be added to the main repo but at some point the amount of code is so overwhelming that we can't focus on developing the core anymore. So stuff like the renderer or material system.

The addons folder is already quite large so focusing is important. And focusing means from time-to-time saying "no". I'm sorry but I feel the PR is just out-of-scope. Maybe other collaborators evaluate this issue differently but my vote stands.

@bandinopla
Copy link
Author

Sweet rejection...

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.

2 participants