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

3D scene won't render in HTML5 export, unless it has at least one DirectionalLight3D, OmniLight3D and SpotLight3D #64295

Closed
dsnopek opened this issue Aug 12, 2022 · 1 comment · Fixed by #64341

Comments

@dsnopek
Copy link
Contributor

dsnopek commented Aug 12, 2022

Godot version

v4.0.alpha.custom_build [ad24789]

System information

Chrome, GLES3

Issue description

It appears as though a 3D scene won't render in an HTML5 export, unless it has at least one DirectionLight3D, one OmniLight3D and one SpotLight3D.

This doesn't affect a 3D scene running with the 'opengl3' driver on the desktop (having only a DirectionalLight3D is enough) - the problem happens only when exported to HTML5.

I can't get 2D to render on HTML5 at all (even though, again, it renders fine with the 'opengl3' driver on my desktop).

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 Node3D as the root
  6. Add a MeshInstance3D with a Cube mesh
  7. Add a DirectionalLight3D
  8. Add a Camera3D that is pointing at the Cube
  9. Save the scene, run the project, and use the current scene as the main scene when prompted
  10. Verify that you can see the cube when running on the desktop!
  11. Export the game to HTML5
  12. 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)
  13. You'll only see the clear color in the web browser - no cube!
  14. Go back to the Godot editor
  15. Add an OmniLight3D
  16. Add a SpotLight3D
  17. Use the "Run exported HTML the system's default browser" button again
  18. Now you WILL see the cube in the web browser!

Minimal reproduction project

g4-html5-test.zip

This project include all 3 lights, so it should actually work! However, if you delete any one of the lights, and export again, it won't render the cube.

@dsnopek
Copy link
Contributor Author

dsnopek commented Aug 12, 2022

Chatted with @clayjohn about this a bit on RocketChat! He has an idea about what it might be

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.

3 participants