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

OBJ meshes get corrupted on reimport on Android editor #80371

Closed
Booklight12 opened this issue Aug 7, 2023 · 22 comments · Fixed by #84852
Closed

OBJ meshes get corrupted on reimport on Android editor #80371

Booklight12 opened this issue Aug 7, 2023 · 22 comments · Fixed by #84852

Comments

@Booklight12
Copy link

Booklight12 commented Aug 7, 2023

Godot version

4.1.stable

System information

Android13

Issue description

I'm trying to import the obj model file on Android but there seems to be some compatibility issues? You can do two tests on both the computer and the mobile side to make sure what I'm saying is true.
Screenshot_2023-08-07-19-44-12-648_org godotengine editor v4

Steps to reproduce

Create an obj file and import it into the Godot engine on Android.

Minimal reproduction project

test.zip

@Booklight12
Copy link
Author

Under no circumstances should a cube look like this
Screenshot_2023-08-07-19-51-56-049_org godotengine editor v4

@Booklight12
Copy link
Author

I need to declare that this is a "door" resource that I found from itch resources, but it appears in such a state in the engine.
Screenshot_2023-08-07-20-05-20-338_org godotengine editor v4

@Zireael07
Copy link
Contributor

Are you 100% sure the models look proper in Blender, that the materials aren't set as two-sided

@Booklight12
Copy link
Author

This is the obj file from my last photo, you can try opening it on blender
door

@Booklight12
Copy link
Author

For files exported by blender this is completely invisible in the editor
Screenshot_2023-08-07-20-44-58-154_org godotengine editor v4
Screenshot_2023-08-07-20-44-23-163_org godotengine editor v4
Screenshot_2023-08-07-20-44-13-733_org godotengine editor v4
Screenshot_2023-08-07-20-44-05-785_org godotengine editor v4

@Booklight12
Copy link
Author

Booklight12 commented Aug 7, 2023

You can see the object only in the preview,It looks like this in blender
Cache_7a95c7a65b3e697f

@Booklight12
Copy link
Author

您是否 100% 确定模型在 Blender 中看起来正确,材质未设置为双面

sure

@Booklight12
Copy link
Author

Screenshot_2023-08-07-23-06-38-967_org godotengine editor v4
I tested it on another Android device

@Booklight12
Copy link
Author

I don't understand why this is happening, it's affecting development.

@Booklight12
Copy link
Author

Other applications can be displayed normally (including maya)
Screenshot_2023-08-07-23-12-12-775_com prisma3D prisma3D

@Booklight12
Copy link
Author

Watch this video

@fire
Copy link
Member

fire commented Aug 7, 2023

I can confirm that that the cube's bottom triangle is missing on the cached project.

editor_screenshot_2023-08-07T123811

But working as a scene on steam stable.

editor_screenshot_2023-08-07T124021

@fire
Copy link
Member

fire commented Aug 7, 2023

Maybe the 4.1.1 version fixed the problem.

@fire
Copy link
Member

fire commented Aug 7, 2023

@clayjohn @m4gr3d @BastiaanOlij Any ideas how to test on Android? The broken obj import seems to be a specific bug.

@Booklight12
Copy link
Author

Booklight12 commented Aug 7, 2023

4.1.1 did not fix the problem, in fact, when I repeatedly tried to import obj files, I found that their shapes would become strange
Screenshot_2023-08-08-07-47-21-868_org godotengine editor v4

@akien-mga
Copy link
Member

I confirm the bug with 4.1.1 on Android (Xiaomi Poco F1). Both the mobile and GL renderer seem to have the same issue.

I tried switching the MRP's obj to import as scene, which didn't solve it, but after switching back to import as mesh I managed to get a good import (3 default cubes). Then hitting reimport again made the cubes disappear.

@akien-mga akien-mga changed the title Unknown support for obj files. OBJ meshes get corrupted on reimport on Android editor Aug 8, 2023
@Booklight12
Copy link
Author

sure

@bitsawer
Copy link
Member

bitsawer commented Aug 8, 2023

Possibly related if the mesh reimport process tries to read back mesh data at some point: #75599

@Booklight12
Copy link
Author

This is the error reported when exporting. Is there anything else I can do?
Screenshot_2023-08-09-21-07-09-955_org godotengine editor v4

@Booklight12
Copy link
Author

Please, fixing this bug is important to me

@Calinou
Copy link
Member

Calinou commented Aug 9, 2023

Please, fixing this bug is important to me

Issues are resolved by contributors on a best-effort basis. We can't provide an ETA on when this will be fixed.

@ZeroLikviz
Copy link

ZeroLikviz commented Oct 30, 2023

hi guys, I have an idea why this might be happening. I have 2 devices: realme c21 with android 11 and Xiaomi pad 5 with android 13. I've been programming on both of them using C++. I have created a graphical application using SDL2. As you know, SDL2 uses double buffering, and if everything was fine on Realme, then on Xiaomi pad 5 the second buffer was constantly changing, various incomprehensible pieces appeared there, and sometimes it was completely cleaned. I solved the problem by manually creating a buffer.

As I said, the problem was only on the Xiaomi pad 5. I decided to check if the problem is related to the device. I asked a friend for a Poco x 3 pro and after launching the program, I realized that the problem was related to either MIUI or android 13.

In the end, I decided to download Godot 4 on Realme c21 and the result only confirmed my theory: the problem is related to either MIUI or android 13. As far as I understand, something affects dynamic memory when no one uses it and in order to solve the problem, it is necessary to save data in dynamic memory, until then, while this data will not be needed. Also, the erase command sometimes breaks data in the container, I didn't look at the code, but if the erase command is used, then you should be more careful with it.

I hope this information helps a little.

Realme c21:
IMG-20231030-WA0000

Xiaomi pad 5:

Screenrecorder-2023-10-30-18-48-26-217.mp4

here is some more information:
• I saved the resulting mesh into a variable and then started constantly assigning it to CSGMesh3d.mesh, as a result, the shape was incorrect, but it has not changed during test
• I tried to do the same thing, but instead of mesh I assigned mesh.duplicate(), as a result the form was constantly changing

Xiaomi pad 5:

Screenrecorder-2023-10-30-21-12-02-144.mp4

I saved the mesh when it took the correct shape and then I tried assigning the mesh to CSGMesh3D many times. As a result, the mesh that was in CSGMesh3D was constantly changing.

Screenrecorder-2023-10-30-21-37-44-227.mp4

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.

9 participants