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

On certain Android devices, 3D models do not appear #86956

Closed
Skyvastern opened this issue Jan 8, 2024 · 5 comments
Closed

On certain Android devices, 3D models do not appear #86956

Skyvastern opened this issue Jan 8, 2024 · 5 comments

Comments

@Skyvastern
Copy link

Tested versions

  • Reproducible in: 4.2.1, 4.2, 4.1.3, 4.1.2, 4.1.1, 4.1
  • Not reproducible in: 4.0.3 and before (didn't encounter the issue in these versions)

System information

Windows 11 64-bit, Ryzen 5 5500U, 8GB RAM, Nvidia GTX 1650

Issue description

So if the game has a 3D model, then it does not render on some Android devices. Interestingly, when I open the app on my phone for the very first time after installing it, the models are rendererd properly. However, after opening the app second time, the model disappears. To fix this, I have to either delete cache/data, or reinstall the app again. Doing this it works, however launching the app again makes the model disappear.

So this issue starts happening after we open the app second time and beyond.

Other Observations

3D Models

  • This is not happening with primitive models made inside Godot. It only happens with imported models. I have right now only tested this with .glb file.
  • Even with imported models, when imported a basic Blender's monkey mesh with a material, it rendered properly.
  • However, all the Mixamo models I tested, and some of my owns didn't work.

Android Devices

  • So it happens only with some Android devices.
    • It didn't work on Poco M4 Pro.
    • However, when tested on Realme 9 Pro 5G, it worked without any issues.
    • Similar problems happened with few more devices, but I don't remember their names.

Similar/Same Issue

Steps to reproduce

  1. Download the MRP provided.
  2. Extract the apk/project files to your desired location.
  3. Open the project files using Godot.
  4. Go to Project -> Export.
  5. Select Android (Runnable).
  6. Press export project, and save your file to your desired location.
  7. Install the apk on your Android phone.
  8. Run the app for the first time (everything will work fine & you will see character and monkey models).
  9. Run the app second time (depending on your device, the character model on left will disappear).

Minimal reproduction project (MRP)

Android 3D Rendering Issue.zip

@Zireael07
Copy link
Contributor

As you already noted, duplicate of #80668 most likely

@bitsawer
Copy link
Member

bitsawer commented Jan 8, 2024

Are you using the compatibility renderer? This:

Interestingly, when I open the app on my phone for the very first time after installing it, the models are rendererd properly. However, after opening the app second time, the model disappears.

might also point towards #82419. You can try disabing shader cache as mentioned in #82419 (comment) and see if that helps.

This is possibly a duplicate of some of the mentioned issues, but let's see if we can get any more info.

@Skyvastern
Copy link
Author

Skyvastern commented Jan 8, 2024

Are you using the compatibility renderer? This:

Interestingly, when I open the app on my phone for the very first time after installing it, the models are rendererd properly. However, after opening the app second time, the model disappears.

might also point towards #82419. You can try disabing shader cache as mentioned in #82419 (comment) and see if that helps.

This is possibly a duplicate of some of the mentioned issues, but let's see if we can get any more info.

I had rendering mode set to compatibility already. However, shader cache was enabled, so disabling it actually worked on the sample project I provided. Looks like this is the cause of the issue.

Gonna confirm the same for the main project I am working on, and if it works there too, then that means shader cache was the issue!

@Skyvastern
Copy link
Author

Skyvastern commented Jan 9, 2024

Are you using the compatibility renderer? This:

Interestingly, when I open the app on my phone for the very first time after installing it, the models are rendererd properly. However, after opening the app second time, the model disappears.

might also point towards #82419. You can try disabing shader cache as mentioned in #82419 (comment) and see if that helps.
This is possibly a duplicate of some of the mentioned issues, but let's see if we can get any more info.

I had rendering mode set to compatibility already. However, shader cache was enabled, so disabling it actually worked on the sample project I provided. Looks like this is the cause of the issue.

Gonna confirm the same for the main project I am working on, and if it works there too, then that means shader cache was the issue!

Yes, disabling shader cache fixed the problem in the main project I was working on. Thanks a lot!

So, I think its confirmed that shader cache is the issue. Would like to know that is disabling shader cache the expected behaviour on Android with 3D models, or is it something that has to be resolved? And is there any downsides of disabling it?

Either way, the current workaround or the expected thing to do fixed the issue for me. Thanks again for the help!

Update: Though everything works fine, however in the editor's error logs I am getting this error now: _save_to_cache: Condition "f.is_null()" is true.

@bitsawer
Copy link
Member

Thanks for confirmation, closing this as a duplicate of #82419 as disabling shader caching seems to help.

As for disabling shader cache, see #82419 (comment).

If you can reproduce the _save_to_cache() error, it might be a good idea to make a new, separate issue for it if there is no existing one yet.

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