atteneder / KtxUnity

Load KTX and Basis Universal textures at runtime
Apache License 2.0
223 stars 42 forks source link

Wrong TranscodeFormat in WebGL run in iPad #39

Closed eatmicco closed 3 years ago

eatmicco commented 3 years ago

Hi, first of all thank you for the great plugin! We want to confirm if this plugin is the correct choice for us if we want to use the compressed texture in our WebGL iPad release since iPad doesn't support DXT format. Unfortunately what we found was that in iPad, we are still having the texture to be transcoded to DXT format.

Here is the extensions that are used in iPad: image

But strangely, the GraphicsFormat results was different (e.g. PVRTC is not supported) image

I used LambdaTest to test the build using the setup for iPad 6th Gen with Safari 14. Here is the specs of iPad 6th Gen: https://igotoffer.com/apple/ipad-6th-generation-2018

I can probably force the use of PVRTC based on the extensions that are supported by the GPU for now (we can get that from https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getSupportedExtensions), but I thought I should still report this so that we can all have a proper fix if needed.

atteneder commented 3 years ago

Hi @eatmicco ,

Thanks for this detailed, insightful report!

As jukka_j already pointed out, this is likely a Unity limitation that resolved in 2021.2.

I'd try:

If forcing works, we could arguably introduce some exceptions or better feature detection to work around this for now.

Another solution would be to use native code to do the texture upload (and feature detection; see #40 )

hth

eatmicco commented 3 years ago

Hi @atteneder, Thanks for the great response! Too bad about the Unity limitation, unfortunately 2021.2 is still pretty far from the Unity version that we currently use (we are using 2019.2) and upgrading is pretty big deal and need really in-depth planning on our part. I will try all of your suggestions and see if I can get any leads from those.

atteneder commented 3 years ago

Unity 2021.2 and WebGL does not work at the moment (See #43 ; will get fixed in version 3.0.0)

atteneder commented 3 years ago

@eatmicco Question about what is the actual problem:

If it's two yesses, then I'd say it is expected behavior and will be improved with Unity 2021.2 and KtxUnity 3.0.0

Thanks

eatmicco commented 3 years ago

@atteneder Thank you for the response, apologies for not reporting my findings in this thread. The answer for your questions are 2 yesses and unfortunately not feasible for our needs right now. Although right now we use another method, I really appreciate for the help and response all this time. I will give this plugin a go one more time in the future (maybe after we migrate to 2021.2) and hopefully we can use it in our product then.

Cheers :)