Skip to content
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

Slow rendering on : webgpu_compute_particles #30344

Open
Makio64 opened this issue Jan 17, 2025 · 5 comments
Open

Slow rendering on : webgpu_compute_particles #30344

Makio64 opened this issue Jan 17, 2025 · 5 comments

Comments

@Makio64
Copy link
Contributor

Makio64 commented Jan 17, 2025

Description

On iphone12 pro max it seems the "webgpu_compute_particles" is very slow, I originally though its the computation, but it's actually the particule rendering:

  • Webgpu safari, top angle : 60fps
  • Webgpu safari, bottom angle : 20fps

I'm a bit surprised cause I though render 1M particles would have been a piece of cake in webgpu.

For the moment I can do a PR :

  • to setup 256k particles on mobiles by default
  • add a gui to select the number and regenerate the particles system.
  • pause/play the physics

So it might help to monitoring the performance on various mobile

Reproduction steps

  1. open the example on mobile
  2. play with the camera angle

Code

X

Live example

X

Screenshots

X

Version

r172

Device

Mobile

Browser

Safari

OS

iOS

@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 22, 2025

I'm a bit surprised cause I though render 1M particles would have been a piece of cake in webgpu.

When an application is fragment shader bound, using WebGPU won't help.

I do not vote to introduce mobile specific presets in the examples since that will only complicate things. As a quick fix, we could lowering the particle count to 500000 which should noticeably improve the performance and the example will still look good.

@Makio64
Copy link
Contributor Author

Makio64 commented Jan 26, 2025

I think it add just a fews lines to dispose and recreate the buffer ( or reallocate ) and call the computeInit again once the user select the number desired ?

@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 26, 2025

If we start doing this in webgpu_compute_particles, it's fair to ask doing it in all other compute examples which I'd like to avoid. Let's try to keep things as simple as possible.

@Makio64
Copy link
Contributor Author

Makio64 commented Jan 28, 2025

Having one example which can be used as benchmark performance sounds good to me but I see the concern of having to update the other examples.. but also why not ? TSL prove one good things after using it for a while : its super easy to produce short, clean, reusable code. So update examples would be not long and good for benchmarking.

Also I'm not sure about threejs target but most of my clients in 2025 for webgl are very concern about mobile performance and being able to prove xxx particles will works well would be nice.

But if you dont want it i let you close this and i will just reduce to 512k the number of particles in a PR.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 28, 2025

i will just reduce to 512k the number of particles in a PR.

That sounds good to me. We can close this issue when the PR got merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants