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

Distant coloured billboards fade out on Android due to incorrect mipmap generation or rendering #54220

Open
wilbefast opened this issue Oct 25, 2021 · 5 comments

Comments

@wilbefast
Copy link

wilbefast commented Oct 25, 2021

Godot version

v3.3.3.stable.official [b973f99]

System information

Android 8.1.0 (Nexus 5X) - GLES2

Issue description

Billboards that use coloured textures fade out as they move away from the camera on Android 8.1.0. Bizarrely billboards with black and white textures do not exhibit this behaviour. The following videos were captured using the minimal sample project attached below.

Windows (expected behaviour):

minimal-windows.mp4

Android (unexpected behaviour):

minimal-android.mp4

Steps to reproduce

  1. Add a Sprite3D, set to billboard mode, to a scene.
  2. Use the default Godot icon.png as a texture for the billboard.
  3. Add a Camera to the scene, facing the billboard.
  4. Have a script move the two apart.
  5. Notice that, only on Android, the billboard fades out as it moves away from the camera.

Minimal reproduction project

GodotAndroidBugMinimal.zip

@Calinou
Copy link
Member

Calinou commented Oct 25, 2021

This is likely due to erroneous mipmap generation or rendering. Does it occur if you disable Mipmaps in the texture's import options, then export the project to Android again?

@wilbefast
Copy link
Author

wilbefast commented Oct 25, 2021

@Calinou I can confirm that disabling mipmaps in the import settings solves the issue 👍

edit: even so I would assert that this is still a bug, as the behavior, for a given set of import settings, should be the same on all platforms.

@Calinou Calinou changed the title Distant coloured billboards fade out on Android Distant coloured billboards fade out on Android due to incorrect mipmap generation or rendering Oct 25, 2021
@Calinou
Copy link
Member

Calinou commented Oct 25, 2021

@wilbefast Does this occur if you keep Mipmaps enabled, but change the texture compression mode to Lossless? Perhaps ETC1-compressed texture mipmaps are incorrectly generated or stored.

VRAM compression uses S3TC on desktop platforms, ETC2 on mobile/web platforms when using GLES3 and ETC1 on mobile/web platforms when using GLES2. ETC1 compression in particular does not support an alpha channel, so you want to use lossless compression for transparent textures instead.

@wilbefast
Copy link
Author

wilbefast commented Oct 26, 2021

@Calinou I can confirm that with Mipmaps enabled and Lossless texture compression the issue does not occur. Your theory seems solid, though I'm not a GLES expert by any means so I wouldn't really know. In any case so far it is standing up to scrutiny 👍

@akien-mga akien-mga modified the milestones: 3.4, 3.5 Nov 8, 2021
@Calinou
Copy link
Member

Calinou commented Nov 13, 2021

Also confirmed to occur in HTML5 on Android: https://godotengine.org/qa/120596/transparent-objects-fading-out-from-camera-mobile-browser

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

3 participants