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

No texture alpha on Android/GLES2 #26211

Closed
ProbDenis opened this issue Feb 23, 2019 · 6 comments
Closed

No texture alpha on Android/GLES2 #26211

ProbDenis opened this issue Feb 23, 2019 · 6 comments

Comments

@ProbDenis
Copy link
Contributor

Godot version:
Godot 3.1 Beta 6

OS/device including version:
Manjaro Linux

Issue description:
I'm trying to port my 3D game to mobile devices, and it's not going to plan. ;-)
GLES3 is too slow, so I'm using GLES2, which is supposed to run well on mobile. At first the game failed to load any textures, so I disabled ETC2 and enabled ETC compression instead (this should be enabled by default for mobile instead of just failing, but that's a different issue). So now the game does run a lot better on my Android device, but alpha transparency doesn't work any more, and any transparent parts in the textures become black. I suppose this has to do with the texture compression - but is this a bug, or is it intended? Is there anything I can do about it?

@hpvb
Copy link
Member

hpvb commented Feb 24, 2019

This is likely already fixed. Please try our next release, it should drop soon.

@ProbDenis
Copy link
Contributor Author

I just tried it with Beta 7, and it's still the same. No alpha in textures with ETC compression.

@Calinou
Copy link
Member

Calinou commented Feb 24, 2019

According to Wikipedia, ETC1 does not support compressing images with an alpha channel (unlike ETC2). Perhaps it could be handled internally by creating two textures in the import process instead of one (one RGB texture, and another grayscale that represents the alpha channel)?

@wombatstampede
Copy link
Contributor

While using ETC may be possible (see link below) it is as well possible for now to use neither ETC nor ETC2.

@ProbDenis Instead of "Video RAM" remport the alpha textures with "Lossy" (or probably also "Lossless")
I just tried it out with "Lossy" and it worked good on my android device (using GLES2, naturally).
May use more video ram though.

Here's the source for workaround to "enable" alpha on ETC1.
https://web.archive.org/web/20160624152133/http://malideveloper.arm.com/resources/sample-code/etcv1-texture-compression-and-alpha-channels/

@TIBI4
Copy link

TIBI4 commented Mar 29, 2019

@wombatstampede I can confirm that reimporting with "lossless" will make alphas work again too.

@Calinou
Copy link
Member

Calinou commented May 14, 2020

Closing in favor of godotengine/godot-proposals#822, as feature proposals are now tracked on the Godot proposals repository.

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

5 participants