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

Blend shapes have incorrect size on HTML5 platform (GLES3) #60525

Closed
Tracked by #63198
Atem1995 opened this issue Apr 26, 2022 · 13 comments
Closed
Tracked by #63198

Blend shapes have incorrect size on HTML5 platform (GLES3) #60525

Atem1995 opened this issue Apr 26, 2022 · 13 comments

Comments

@Atem1995
Copy link

Atem1995 commented Apr 26, 2022

Godot version

3.x and 3.4.

System information

window10, html5

Issue description

Blend shapes behave inconsistently in html5 and window10, in html5, it is obviously enlarged by more than 2 times

on Android,it works normal, just not right on html5.
1650965553(1)
1650965675(1)
.

Steps to reproduce

Minimal reproducti

blend_shapes_test.zip
This minimal project is on version 3.4.4 stable. But the same problem is on the 3.x version. I had tested it.

@Zireael07
Copy link
Contributor

Please give the issue a descriptiive title and include a minimal project

@Chaosus Chaosus changed the title [] Blend shapes have incorrect size on HTML5 platform Apr 26, 2022
@Atem1995
Copy link
Author

Please give the issue a descriptiive title and include a minimal project

Sorry,hah...

@Calinou Calinou changed the title Blend shapes have incorrect size on HTML5 platform Blend shapes have incorrect size on HTML5 platform (GLES3) Apr 26, 2022
@Calinou Calinou added this to the 3.x milestone Apr 26, 2022
@Calinou
Copy link
Member

Calinou commented Apr 26, 2022

Can you reproduce this after switching to the GLES2 rendering backend and exporting to HTML5 again?

@Atem1995
Copy link
Author

Atem1995 commented May 6, 2022

Can you reproduce this after switching to the GLES2 rendering backend and exporting to HTML5 again?

@Calinou When switching to gles2, objects with Blend shape disappeared. There should be no rendering
捕获
.

@Calinou
Copy link
Member

Calinou commented May 6, 2022

@Atem1995 Does it work outside of HTML5 (i.e. when running the project natively)?

@Atem1995
Copy link
Author

Atem1995 commented May 6, 2022 via email

@clayjohn
Copy link
Member

clayjohn commented May 6, 2022

It looks like this is where the error is coming from.

for (int i = 0; i < p_blend_shapes.size(); i++) {
ERR_FAIL_COND(p_blend_shapes[i].size() != array_size);
}

It is saying that one of the blend shapes supplied has a different amount of data than the base mesh. On the face of it, it is unclear why this would trigger on HTML5 builds but not others.

@Atem1995
Copy link
Author

Atem1995 commented May 6, 2022 via email

@clayjohn
Copy link
Member

clayjohn commented May 6, 2022

Can it be fixed?I am trying to make a web3.0 game with Godot.If it could not work, maybe babylon.js is another choice... :/

I just dug into the GLES2 issue a little bit, I think the error comes from here:

if (!config.support_half_float_vertices && uses_half_float) {
uint32_t new_format = p_format;
PoolVector<uint8_t> unpacked_array = _unpack_half_floats(array, new_format, p_vertex_count);
mesh_add_surface(p_mesh, new_format, p_primitive, unpacked_array, p_vertex_count, p_index_array, p_index_count, p_aabb, p_blend_shapes, p_bone_aabbs);
return; //do not go any further, above function used unpacked stuff will be used instead.
}

The rasterizer has to decompress the vertex attributes because it doesn't support half_floats, but it doesn't decompress the blend shapes! So the blend shapes end up not aligning with the original mesh and the function emits an error. The fix on our end is to make sure that the blend shapes get decompressed. On your end, you can fix things now by importing your mesh with compression turned off for UVs (right now they are compressed in the MRP).

With respect to Babylon.js. It is also a great choice if your target is web-only!

@clayjohn
Copy link
Member

clayjohn commented May 6, 2022

I've made a pull request fixing the GLES2 issue, I'm trying to reproduce the GLES3 issue now, but I might not have time today to fix it.

@clayjohn
Copy link
Member

clayjohn commented May 6, 2022

Okay, fixes are in for both the GLES3 issue and the GLES2 issue. Once those get merged this should be totally fixed.

@akien-mga akien-mga modified the milestones: 3.x, 3.5 May 6, 2022
@Atem1995
Copy link
Author

Atem1995 commented May 7, 2022

Okay, fixes are in for both the GLES3 issue and the GLES2 issue. Once those get merged this should be totally fixed.

Thanks!Good job!Man! 👍

@clayjohn
Copy link
Member

clayjohn commented May 7, 2022

Closing as fixed by #60832

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

6 participants