Is it possible to run compressed image in OpenFl ?
The decompressed image data can be RGB ( 24 bits ) or RGBA ( 32 bits ) , for each color channel takes 1 byte.
This mean , when I use image atlas with size :
2048 x 2048 * 4 = 16 MB Ram ( the image itself is about 1.5 Mb size on disk)
At the other side , WebGL provide support for a number of compressed texture formats such as :
DXT : desktop devices and some Android devices
PVR : all iOS devices / some Android
ETC1 : most Android devices
Which give about > 80% less in memory size i.e. if JPG use 30 MB ram, DXT will use only 5 MB.
You could create and use the openfl.display3D.textures.Texture directly without Starling on a Context3D (also for 2D games). Not sure if the Tilemap class support Textures, maybe you need to adjust it or create your own Tilemap class.
Also open to other improvements to BitmapData to support compressed textures, we should already support BitmapData without an image object (using disposeImage()) which means the image can only be used with hardware rendering. Then the texture we use could be a compressed texture, but I forget if we would need to use different values when we go to render that texture in GL, or if its all wrapped up in the texture creation
Hi! ETC1 not working on android. I’ve tested basic away3d app with atf texture. It works fine on html targets in google chrome, mozilla, ie edge and on windows native. But nothing is showing on android platform. OES_compressed_ETC1_RGB8_texture is supported (I’ve add traces to check it) but texture is not showing and there is no errors.
I have not setup Android compilation successfully, only tested via WebGL. Can you therefore try to add some trace like below into openfl/_internal/stage3D/opengl/GLTexture.hx in uploadCompressedTextureFromByteArray?
replace: var format = GLTextureBase.__compressedTextureFormats.toTextureFormat(alpha, gpuFormat); if (format == 0) return;
with var format = GLTextureBase.__compressedTextureFormats.toTextureFormat(alpha, gpuFormat); trace("gpuFormat: " + gpuFormat + " format: "+ format); if (format == 0) return;