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

2D won't render in HTML5 export #64453

Closed
dsnopek opened this issue Aug 15, 2022 · 0 comments · Fixed by #65442
Closed

2D won't render in HTML5 export #64453

dsnopek opened this issue Aug 15, 2022 · 0 comments · Fixed by #65442

Comments

@dsnopek
Copy link
Contributor

dsnopek commented Aug 15, 2022

Godot version

v4.0.alpha.custom_build [ad24789] + changes from PR #64295

System information

Chrome, GLES3

Issue description

After PR #64295, 3D scenes will render fine when exported to HTML5! However, there are still problems with 2D.

Running a 2D scene with the 'opengl3' driver works fine for me on the desktop. But when exported to HTML5, the app will run (I can write to the console and do things in _process()) but it won't render anything.

Additionally, putting a CanvasLayer with a Sprite2D on a 3D scene will render fine with the 'opengl3' driver on the desktop, but the 2D elements won't be shown when exported to HTML5. (However, it's still possible to interact with the 2D elements - I've also tried using a Button, and I'll get it's "pressed" signal when clicked, but it won't render at all.)

In the Chrome developer console, I get the same warning that I got when 3D wasn't working (before #64295):

GL_INVALID_OPERATION: It is undefined behaviour to have a used but unbound uniform buffer.

(Admittedly, I also see this warning when running Godot 3 apps in HTML5, but there everything works fine.)

Additionally, when I run a "2D on 3D" scene, I get this warning:

GL_INVALID_OPERATION: It is undefined behaviour to use a uniform buffer that is too small.

And, if I run on the Oculus browser (I'm ultimately trying to get WebXR working in Godot 4 ;-)), I see these warnings:

GL ERROR :GL_INVALID_OPERATION : glDrawElements: uniform buffers : buffer or buffer range at index 2 not large enough
GL ERROR :GL_INVALID_OPERATION : glDrawArraysInstancedANGLE: uniform buffers : buffer or buffer range at index 2 not large enough

That seems like a potentially more detailed version of the "buffer that is too small" warning?

Also, I can't consistently get it to happen, but I've also seen this warning in my testing:

GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is incomplete: Driver does not support this framebuffer configuration.

Steps to reproduce

  1. Create a new project
  2. Go to "Project settings..." and turn on "Advanced Settings"
  3. In "Rendering" -> "Driver" set the "Driver Name" to "opengl3"
  4. Restart the editor
  5. Create a new scene with a Node2D as the root
  6. Add a Sprite, and set the "icon.png" as it's Texture
  7. Save the scene, run the project, and use the current scene as the main scene when prompted
  8. Verify that you can see the icon texture when running on the desktop!
  9. Export the game to HTML5
  10. Use the "Run exported HTML the system's default browser" button in the upper-right (the one that looks like the HTML5 logo, but the normal run button)
  11. You'll only see the clear color in the web browser - no icon!

Minimal reproduction project

godot4-gles3-2d.zip

The main.tscn (which is set as the main scene) does only 2D as described in the "Steps to reproduce". This'll show this warning in the browser console:

GL_INVALID_OPERATION: It is undefined behaviour to have a used but unbound uniform buffer.

There is also a main_2d_on_3d.tscn, which puts 2D on a 3D scene - you'll need to set it as the main scene and export to run it in the browser. This shows this warning in the console:

GL_INVALID_OPERATION: It is undefined behaviour to use a uniform buffer that is too small.
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.

1 participant