crashinvaders / gdx-basis-universal Goto Github PK
View Code? Open in Web Editor NEWKTX2/Basis Universal supercompressed GPU textures for libGDX game framework.
KTX2/Basis Universal supercompressed GPU textures for libGDX game framework.
Hi,
Tried to use Basisu/KTX2 on iOS. But app just closed at loading Basisu texture on iOS Simulator and real iPhone device.
log("before load Basisu texture");
texture = new Texture(new BasisuTextureData(Gdx.files.internal("textures/my-texture.basis")) );
log("after load Basisu texture");
Log event "after load Basisu texture" never happened. The app is just close himself.
Try it with "gdx-backend-robovm" and with "gdx-backend-robovm-metalangle" with the same result.
With second one also got this text in log:
2023-11-27 11:27:02.173 My.IOSLauncher[3270:49041] Can't get Metal device. Metal Display won't be available.
2023-11-27 11:27:02.218 My.IOSLauncher[3270:49041] MGLKViewController resume
This issue picks up on the discussion about mipmaps started with @Peter-Warlock in #2
The naive idea was to use glGenerateMipmap
to automatically create all the necessary MIP levels for compressed KTX2/Basis textures. Well, guess what, this OpenGL function is only meant to be used for non-compressed textures.
GL_INVALID_OPERATION is generated if the zero level array is stored in a compressed internal format.
An interesting find was that libGDX actually generates mipmaps on CPU. Why is that I can't tell. But anyways, it all means that we actually have to unpack and use other MIP levels of a KTX2/Basis texture if they are bundled in.
I'll try to find some time in the next couple of weeks to implement it.
how do I load a basis universal sprite sheet created gdx-texture-packer into libgdx?
Hello,
Crash on old devices with that crash stack:
g2.b0: Couldn't load shared library 'gdx-basis-universal' for target: Android
at g2.c0.d(SourceFile:123)
at l2.e.D(SourceFile:23)
at l2.a.<init>(SourceFile:11)
at l2.f.prepare(SourceFile:28)
at o1.l.v(SourceFile:34)
at o1.l.<init>(SourceFile:4)
at x6.o0.<init>(SourceFile:83)
at x6.y.k(SourceFile:312)
at l1.l.onSurfaceChanged(SourceFile:44)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1512)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH in "libgdx-basis-universal.so" (built with --hash-style=gnu?)
at java.lang.Runtime.loadLibrary(Runtime.java:364)
at java.lang.System.loadLibrary(System.java:526)
at g2.c0.d(SourceFile:29)
at l2.e.D(SourceFile:23)
at l2.a.<init>(SourceFile:11)
at l2.f.prepare(SourceFile:28)
at o1.l.v(SourceFile:34)
at o1.l.<init>(SourceFile:4)
at x6.o0.<init>(SourceFile:83)
at x6.y.k(SourceFile:312)
at l1.l.onSurfaceChanged(SourceFile:44)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1512)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
The same problem and how to fix it was described here:
google/filament#2176
(suggestion to fix here: https://stackoverflow.com/a/59649817/671393)
This only affects ASTC-transcoded textures. I tested and reproduced it on Android API 22 arm64 emulator and it can easily be the problem of the emulator itself.
The emulator reports support for all the ASTC formats though. Needs further investigation.
Supported OpenGL compress texture formats:
[8d64, 9274, 9271, 9272, 9273, 9274, 9275, 9276, 9277, 9278, 9279, 9270, 93b0, 93b1, 93b2, 93b3, 93b4, 93b5, 93b6, 93b7, 93b8, 93b9, 93ba, 93bb, 93bc, 93bd, 93d0, 93d1, 93d2, 93d3, 93d4, 93d5, 93d6, 93d7, 93d8, 93d9, 93da, 93db, 93dc, 93dd]
UPD1: The issue was reproduced on all emulators up to API 27. On API 28-based emulators and up, ASTC textures work as intended. Here's the log error:
device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glCompressedTexImage2D:2583 GL error 0x500
UPD2: The test on an API 24 device shows no sign of the problem.
UPD3: I tested it on Nexus 5 with Android 6 (API 23) and there are no issues.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.