Skip to content

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

Closed
@Waridley

Description

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions