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

ArrayMesh.surface_get_arrays and PrimitiveMesh.get_mesh_arrays return incorrect data on Android #85889

Closed
timo-eberl opened this issue Dec 7, 2023 · 1 comment
Labels

Comments

@timo-eberl
Copy link

Tested versions

  • Reproducible in: 4.0.stable, 4.1.3.stable, 4.2.stable
  • Reproducible in: Android builds (debug and release, release only tested on 4.2.stable), Android Godot Editor (only tested on 4.1.3.stable)
  • Not reproducible in: Linux, Windows

System information

Android 12, arm64 and Android 8.1, arm32 - Mobile and Compatibility Renderers

Issue description

ArrayMesh.surface_get_arrays and PrimitiveMesh.get_mesh_arrays return incorrect data.

When recreating the surface from the obtained data every frame, it looks like this:

The sphere is a PrimitiveMesh, the cube is a cube exported from Blender

android-build.mp4

It should look like this (running on Linux):

expected

Displaying the obtained data from the original mesh of the cube and from the newly created one shows this (changes every time surface_get_arrays is called):

android-build-mesh-arrays

This is the correct data it should display:

original_mesh_arrays: [[(-1, 0.999979, -1), (1, 0.999979, -1), (-1, 0.999979, 1), (1, 0.999979, 1), (1, 0.999979, 1), (1, -1, 1), (-1, 0.999979, 1), (-1, -1, 1), (-1, 0.999979, 1), (-1, -1, 1), (-1, 0.999979, -1), (-1, -1, -1), (1, -1, -1), (-1, -1, -1), (1, -1, 1), (-1, -1, 1), (1, 0.999979, -1), (1, -1, -1), (1, 0.999979, 1), (1, -1, 1), (-1, 0.999979, -1), (-1, -1, -1), (1, 0.999979, -1), (1, -1, -1)], [(-0.00003, 1, -0), (-0.00003, 1, -0), (-0.00003, 1, -0), (-0.00003, 1, -0), (0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 0, 1), (-1, 0.000074, -0.000064), (-1, 0.000074, -0.000064), (-1, 0.000074, -0.000064), (-1, 0.000074, -0.000064), (0.000015, -1, 0.000024), (0.000015, -1, 0.000024), (0.000015, -1, 0.000024), (0.000015, -1, 0.000024), (1, 0.000018, 0.000119), (1, 0.000018, 0.000119), (1, 0.000018, 0.000119), (1, 0.000018, 0.000119), (0.000031, 0.00003, -1), (0.000031, 0.00003, -1), (0.000031, 0.00003, -1), (0.000031, 0.00003, -1)], [-1, -0.00003045622725, -0.00003057986032, 1, -1, -0.00003045622725, -0.00003057986032, 1, -1, -0.00003045622725, -0.00003057986032, 1, -1, -0.00003045622725, -0.00003057986032, 1, 0.00002391735507, 1, 0, 1, 0.00002391735507, 1, 0, 1, 0.00002391735507, 1, 0, 1, 0.00002391735507, 1, 0, 1, 0.00007370114326, 1, 0.00007367134094, 1, 0.00007370114326, 1, 0.00007367134094, 1, 0.00007370114326, 1, 0.00007367134094, 1, 0.00007370114326, 1, 0.00007367134094, 1, 1, 0.00001525902189, 0.00001525865719, 1, 1, 0.00001525902189, 0.00001525865719, 1, 1, 0.00001525902189, 0.00001525865719, 1, 1, 0.00001525902189, 0.00001525865719, 1, -0.00001785159111, 1, 0.00001788139343, 1, -0.00001785159111, 1, 0.00001788139343, 1, -0.00001785159111, 1, 0.00001788139343, 1, -0.00001785159111, 1, 0.00001788139343, 1, -0.00000002980232, 0.99999994039536, 0.00003045622725, 1, -0.00000002980232, 0.99999994039536, 0.00003045622725, 1, -0.00000002980232, 0.99999994039536, 0.00003045622725, 1, -0.00000002980232, 0.99999994039536, 0.00003045622725, 1], <null>, [(0.874998, 0.499992), (0.624994, 0.499992), (0.874998, 0.249989), (0.624994, 0.249989), (0.624994, 0.249989), (0.37499, 0.249989), (0.624994, 0), (0.37499, 0), (0.624994, 1), (0.37499, 1), (0.624994, 0.749996), (0.37499, 0.749996), (0.37499, 0.499992), (0.124987, 0.499992), (0.37499, 0.249989), (0.124987, 0.249989), (0.624994, 0.499992), (0.37499, 0.499992), (0.624994, 0.249989), (0.37499, 0.249989), (0.624994, 0.749996), (0.37499, 0.749996), (0.624994, 0.499992), (0.37499, 0.499992)], <null>, <null>, <null>, <null>, <null>, <null>, <null>, [0, 1, 2, 2, 1, 3, 4, 5, 6, 6, 5, 7, 8, 9, 10, 10, 9, 11, 12, 13, 14, 14, 13, 15, 16, 17, 18, 18, 17, 19, 20, 21, 22, 22, 21, 23]]

new_mesh_arrays: [[(-1, 0.999979, -1), (1, 0.999979, -1), (-1, 0.999979, 1), (1, 0.999979, 1), (1, 0.999979, 1), (1, -1, 1), (-1, 0.999979, 1), (-1, -1, 1), (-1, 0.999979, 1), (-1, -1, 1), (-1, 0.999979, -1), (-1, -1, -1), (1, -1, -1), (-1, -1, -1), (1, -1, 1), (-1, -1, 1), (1, 0.999979, -1), (1, -1, -1), (1, 0.999979, 1), (1, -1, 1), (-1, 0.999979, -1), (-1, -1, -1), (1, 0.999979, -1), (1, -1, -1)], [(-0.000031, 1, -0.000015), (-0.000031, 1, -0.000015), (-0.000031, 1, -0.000015), (-0.000031, 1, -0.000015), (-0.000015, -0.000015, 1), (-0.000015, -0.000015, 1), (-0.000015, -0.000015, 1), (-0.000015, -0.000015, 1), (-1, 0.000061, -0.000076), (-1, 0.000061, -0.000076), (-1, 0.000061, -0.000076), (-1, 0.000061, -0.000076), (0.000015, -1, 0.000015), (0.000015, -1, 0.000015), (0.000015, -1, 0.000015), (0.000015, -1, 0.000015), (1, 0.000015, 0.000137), (1, 0.000015, 0.000137), (1, 0.000015, 0.000137), (1, 0.000015, 0.000137), (0.000031, 0.000031, -1), (0.000031, 0.000031, -1), (0.000031, 0.000031, -1), (0.000031, 0.000031, -1)], [-1, 0, -0.00007629976608, 1, -1, 0, -0.00007629976608, 1, -1, 0, -0.00007629976608, 1, -1, 0, -0.00007629976608, 1, 0.00001525972039, 1, 0.00004577916116, 1, 0.00001525972039, 1, 0.00004577916116, 1, 0.00001525972039, 1, 0.00004577916116, 1, 0.00001525972039, 1, 0.00004577916116, 1, 0.00004578474909, 1, 0.00013735424727, 1, 0.00004578474909, 1, 0.00013735424727, 1, 0.00004578474909, 1, 0.00013735424727, 1, 0.00004578474909, 1, 0.00013735424727, 1, 1, -0.00001525925472, 0.00001525925472, 1, 1, -0.00001525925472, 0.00001525925472, 1, 1, -0.00001525925472, 0.00001525925472, 1, 1, -0.00001525925472, 0.00001525925472, 1, -0.00004577916116, 1, 0.00001525972039, 1, -0.00004577916116, 1, 0.00001525972039, 1, -0.00004577916116, 1, 0.00001525972039, 1, -0.00004577916116, 1, 0.00001525972039, 1, -0.00001525972039, 1, 0.00004577916116, 1, -0.00001525972039, 1, 0.00004577916116, 1, -0.00001525972039, 1, 0.00004577916116, 1, -0.00001525972039, 1, 0.00004577916116, 1], <null>, [(0.874998, 0.499992), (0.624994, 0.499992), (0.874998, 0.249989), (0.624994, 0.249989), (0.624994, 0.249989), (0.37499, 0.249989), (0.624994, 0), (0.37499, 0), (0.624994, 1), (0.37499, 1), (0.624994, 0.749996), (0.37499, 0.749996), (0.37499, 0.499992), (0.124987, 0.499992), (0.37499, 0.249989), (0.124987, 0.249989), (0.624994, 0.499992), (0.37499, 0.499992), (0.624994, 0.249989), (0.37499, 0.249989), (0.624994, 0.749996), (0.37499, 0.749996), (0.624994, 0.499992), (0.37499, 0.499992)], <null>, <null>, <null>, <null>, <null>, <null>, <null>, [0, 1, 2, 2, 1, 3, 4, 5, 6, 6, 5, 7, 8, 9, 10, 10, 9, 11, 12, 13, 14, 14, 13, 15, 16, 17, 18, 18, 17, 19, 20, 21, 22, 22, 21, 23]]

Both the original mesh and the newly created are wrong, the newly created contains even more errors.

Creating meshes from good data works fine, only retrieving data from meshes is broken.

Steps to reproduce

Check out mesh_test.gd from the minimal reproduction project.

Minimal reproduction project (MRP)

godot-mesh-test.zip

@bitsawer
Copy link
Member

bitsawer commented Dec 7, 2023

Thanks for the report. This is fixed in current master by #84852, see the other linked issue reports in the PR. The fix should be in the next 4.2.x release. Closing as duplicate / completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants