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

Excessive loading times using GPUParticles2D in projects exported for HTML5 #87843

Open
derdobs opened this issue Feb 1, 2024 · 2 comments
Open

Comments

@derdobs
Copy link

derdobs commented Feb 1, 2024

Tested versions

Reproducable in 4.2.1 stable and forward (not tested in older versions)

System information

Windows 11

Issue description

Using GPUParticles2D in projects exported for the web/HTML5 incur excessive loading times. A single (default) GPUParticles2D system with a gradienttexture2D needs around 2 seconds to load.

The behaviour was the same accross two computers (Gaming PC and Laptop), Browsers (Firefox, Chrome) and regardless of the "export with debug" box ticked when exporting the project.

In a more complex project with multiple GPUParticles2D nodes with textures, this delay makes GPUParticle2D systems virtually unusable. CPUParticle2D systems did not incur any noticeable loading delays.

Steps to reproduce

Minimal Setup:
Empty 2D Scene with a single GPUParticles2D emitter which renders a GradientTexture2D.
Export the project for the Web and run the result.

Minimal reproduction project (MRP)

particle-test.zip

@Calinou
Copy link
Member

Calinou commented Feb 2, 2024

Shader compilation on WebGL is much slower than on desktop platforms (due to browsers using ANGLE among other things), so we probably need to figure out a way to simplify the particles shader on the web platform similar to what's been proposed for 2D lighting in #70691.

In the meantime, try displaying particles for a single frame when the project starts. This is the standard approach used to ensure all shaders are compiled before gameplay.

Reproducable in 4.2.1 stable and forward (not tested in older versions)

The web export always uses the Compatibility rendering method, as Vulkan doesn't run in web browsers.

@derdobs
Copy link
Author

derdobs commented Feb 2, 2024

Thanks for the response. Displaying the particles for a frame is what I tried, but with 4 particle systems, this would freeze the browser for 30-60 seconds right after loading.
For now I switched to CPU particles when running the project on a web platform.

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