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

Polygon2D with Skeleton2D assigned does not render in the browser with GLES2 #36749

Closed
Waridley opened this issue Mar 3, 2020 · 4 comments
Closed

Comments

@Waridley
Copy link
Contributor

Waridley commented Mar 3, 2020

Godot version: 3.2

OS/device including version: HTML5 (multiple browsers tested on both Windows and Linux)

Issue description:
Any Polygon2D with a Skeleton2D assigned to it does not render in the browser with the GLES2 backend enabled. WebGL does not recognize GL_UNSIGNED_INT as a valid enum variant for the 3rd argument to glVertexAttribPointer in

glVertexAttribPointer(VS::ARRAY_BONES, 4, GL_UNSIGNED_INT, GL_FALSE, sizeof(int) * 4, CAST_INT_TO_UCHAR_PTR(buffer_ofs));

Changing it to GL_UNSIGNED_SHORT or GL_UNSIGNED_BYTE causes the polygons to render, but of course transformations of the bones result in mangled textures when they overflow the type.

Switching to GLES3 fixes the issue, but of course this is generally not recommended for HTML5 games, which caused me to dig into the Godot source before even trying this.

Steps to reproduce:
In a GLES2 project, create a Polygon2D and Skeleton2D node. The Skeleton2D can have bones in it or not; it will not work either way. Assign the Skeleton2D to the Polygon2D, and export the project to HTML5. The polygon will not render, but If you switch the project to GLES3, it will render properly.

@Calinou
Copy link
Member

Calinou commented Mar 3, 2020

See also #35772, which reports the same issue but on Android.

@Waridley
Copy link
Contributor Author

Waridley commented Mar 3, 2020

The Android issue may not have the same root cause, though, because I had no issues getting it to run on Android before trying GLES3. Unless it is device-specific.

@Valeryn4
Copy link
Contributor

Valeryn4 commented Mar 26, 2020

The Android issue may not have the same root cause, though, because I had no issues getting it to run on Android before trying GLES3. Unless it is device-specific.

I tested on this issue. Changed GL_UNSIGNED_INT to GL_UNSIGNED_SHORT. The problem was not solved ...

@akien-mga akien-mga added this to the 3.2 milestone Oct 21, 2020
@akien-mga
Copy link
Member

Fixed by #42119.

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

4 participants