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

GPUParticles2D not emitted in web export #75270

Closed
Sammy-T opened this issue Mar 23, 2023 · 6 comments · Fixed by #75795
Closed

GPUParticles2D not emitted in web export #75270

Sammy-T opened this issue Mar 23, 2023 · 6 comments · Fixed by #75795

Comments

@Sammy-T
Copy link

Sammy-T commented Mar 23, 2023

Godot version

4.0.1.stable

System information

Windows 10, NVIDIA GeForce GTX 960M (31.0.15.3141), GLES3

Issue description

GPUParticles2D are not displayed when exporting for web. CPUParticles2D appear to work as expected but the GPUParticles2D displays nothing upon playing the exported project in a browser.

I've tested in Chrome and Firefox using both Forward+ and Compatibility renderers which all produce the same result for me. Additionally, I've tested a similar project exported using Godot 3.5.2 GLES3 and found that both particles are displayed and emitting correctly in that version.

Steps to reproduce

  1. Create a new project using either Forward+ or Compatibility renderer
  2. Create a main scene with Node2D as the root node
  3. Set up a CPUParticles2D node and a GPUParticles2D node as child nodes
  4. Export for web with default settings
  5. Deploy a dev server to play/debug the exported web project

Minimal reproduction project

Web Particle Test.zip

@Calinou
Copy link
Member

Calinou commented Mar 23, 2023

Can you open developer tools (F12 or Ctrl + Shift + I), reload the page and paste the console output here?

I've tested in Chrome and Firefox using both Forward+ and Compatibility renderers which all produce the same result for me.

Only the Compatibility rendering method can be used in HTML5, since there's no stable API to run Vulkan on the web yet. Trying to use another rendering method will always use Compatibility once you export to HTML5 (check the Project Settings).

@Sammy-T
Copy link
Author

Sammy-T commented Mar 23, 2023

Trying to use another rendering method will always use Compatibility once you export to HTML5 (check the Project Settings).

I figured they were the same output but I didn't know there was a setting there. Thanks for the heads up.

And I hope you don't mind I saved the log to a file. It would've been a crazy long comment otherwise.
localhost-1679612291758.log

@cody82
Copy link
Contributor

cody82 commented Apr 3, 2023

I can reproduce this. GPU particles do not work in web export because of some shader issue:
image
Maybe this is the problem?

@cody82
Copy link
Contributor

cody82 commented Apr 5, 2023

How can I change this file in the build? I modified it, recompiled and I get the same error in an exported game.

@cody82
Copy link
Contributor

cody82 commented Apr 5, 2023

Never mind, I got it. Here is the fix:
master...cody82:godot:fix-html-particle-shader

@Calinou
Copy link
Member

Calinou commented Apr 5, 2023

@cody82 Please open a pull request against the master branch with your changes :)

Remember to modify your changes to follow the code style guidelines too.

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

Successfully merging a pull request may close this issue.

4 participants