www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: kiffa on April 17, 2013, 05:48:44 am

Title: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kiffa on April 17, 2013, 05:48:44 am
I used Texture.setTextureCompression(true) ;

But i'm not clear how it works, create normal-texture from image file -> compress it to ect1-texture -> upload to gpu, right?

Could i use pre-compressed etc1-texture file which is created by the etc1 tool of android(or another etc1 tools)?  My purpose is to decrease the size of APK and the memory usage (in order to use larger texture to improve the details).

Does texture compression always improve the performance? I know it will decrease the bandwidth usage of texture, but i am not clear if it will consume more time to access the texels(seek/uncompress/read etc...);
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on April 18, 2013, 08:26:31 am
Yes, that's basically how it works. And no, you can't use precompressed textures. There was some technical issue with that, that i don't remember ATM. Compressing a texture to ETC1 will give you the same memory savings as using 16bit textures, but the image quality is usually higher (as long as no alpha channel is being used).
Using ETC1 increases texture upload times but shouldn't have a negative impact on performance at runtime. It might improve rendering performance, but to be honest, i've never experienced that.
In Config, there's this switch: http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#cacheCompressedTextures (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#cacheCompressedTextures). If you set it to true, give your Activity the rights to write files and assign a Virtualizer to the TextureManager, jPCT-AE will cache compressed textures on your SD card to decrease startup time for subsequent runs.
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kiffa on April 18, 2013, 10:28:14 am
Thanks, and do you have the plan to support precompressed etc1 and etc2(which is the one of the standard of es 3.0) in the near future? I think this  feature is useful for mobile app.
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kkl on January 15, 2014, 01:46:09 pm
It would be great if etc1 can be cached in memory and be used during runtime. I had tried it on live wallpaper and I notice it's extremely slow (a short stutter) when live wallpaper resumed from sleep. Converting etc1 during runtime after context change makes the live wallpaper looking quite bad. Is there any plan for this feature in the future? Would appreciate it a lot for live wallpaper case.

p/s: Using cacheCompressedTextures still looks slow during live wallpaper resume.
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on January 15, 2014, 02:16:10 pm
Keep in mind that this Config switch does nothing unless you assign a Virtualizer to your TextureManager.
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kkl on January 15, 2014, 03:23:48 pm
Yes, I did set the virtualizer to TextureManager. It's noticeably faster than not setting the cacheCompressTextures, but it still stutters when resuming the wallpaper.
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on January 15, 2014, 08:44:59 pm
Might be the driver then...i don't see how to improve this. Loading the data from the sdcard is fast, that can't cause the stutter. And the rest is just simple texture uploading as usual. Is it different in performance when not using texture compression?
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kkl on January 16, 2014, 03:22:44 pm
Yes. Without compression, the resume is almost instant, but stutter a short while with compression. Probably  I'm compressing few big textures, and it's slow to open file IO for multiple files. Is it possible to keep etc1 raw data in memory (if we use the compression)? I think the live wallpaper would resume instantly that way.
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on January 16, 2014, 08:31:57 pm
I could add some option to cache into main memory instead, but i'm finding it hard to believe that loading from the sdcard should be an issue. Just to make sure that we are talking about the same thing here: We are talking about http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Texture.html#setTextureCompression(boolean) (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Texture.html#setTextureCompression(boolean)) here, not about http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Texture.html#compress() (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Texture.html#compress()), right?

Can you post some logs that help to see where the time is spent?
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kkl on January 17, 2014, 02:47:50 am
Yes, we are talking about setTextureCompression(boolean). Just a little thought; if etc1 data is kept in main memory, should the original bitmap data be cleared from memory? Or else, it would have two copies of same texture data in main memory which would likely to cause out of memory problem, IMHO.

BTW, here's the log when live wallpaper resumed.
Code: [Select]
01-17 09:39:47.966: I/jPCT-AE(24292): OpenGL context has changed(2)...recovering for renderer 2/1!
01-17 09:39:47.966: I/jPCT-AE(24292): Creating buffers...
01-17 09:39:47.971: I/jPCT-AE(24292): Compressing texture to ETC1...
01-17 09:39:48.081: I/jPCT-AE(24292): Loaded etc1_0_257781532288.tex from cache!
01-17 09:39:48.081: I/jPCT-AE(24292): ...done in 109/1ms
01-17 09:39:48.086: I/jPCT-AE(24292): Compressing texture to ETC1...
01-17 09:39:48.111: I/jPCT-AE(24292): Loaded etc1_1_16130942465.tex from cache!
01-17 09:39:48.111: I/jPCT-AE(24292): ...done in 26/1ms
01-17 09:39:48.111: I/jPCT-AE(24292): Compressing texture to ETC1...
01-17 09:39:48.121: I/jPCT-AE(24292): Loaded etc1_2_1011851863.tex from cache!
01-17 09:39:48.121: I/jPCT-AE(24292): ...done in 9/1ms
01-17 09:39:48.121: I/jPCT-AE(24292): Compressing texture to ETC1...
01-17 09:39:48.126: I/jPCT-AE(24292): Loaded etc1_3_64468099.tex from cache!
01-17 09:39:48.126: I/jPCT-AE(24292): ...done in 3/1ms
01-17 09:39:48.126: I/jPCT-AE(24292): Compressing texture to ETC1...
01-17 09:39:48.126: I/jPCT-AE(24292): Loaded etc1_4_4264604.tex from cache!
01-17 09:39:48.126: I/jPCT-AE(24292): ...done in 1/1ms
01-17 09:39:48.126: I/jPCT-AE(24292): Compressing texture to ETC1...
01-17 09:39:48.126: I/jPCT-AE(24292): Loaded etc1_5_350879.tex from cache!
01-17 09:39:48.126: I/jPCT-AE(24292): ...done in 1/1ms
01-17 09:39:48.131: I/jPCT-AE(24292): Compressing texture to ETC1...
01-17 09:39:48.131: I/jPCT-AE(24292): Loaded etc1_6_46378.tex from cache!
01-17 09:39:48.131: I/jPCT-AE(24292): ...done in 1/1ms
01-17 09:39:48.131: I/jPCT-AE(24292): Compressing texture to ETC1...
01-17 09:39:48.131: I/jPCT-AE(24292): Loaded etc1_7_18736.tex from cache!
01-17 09:39:48.131: I/jPCT-AE(24292): ...done in 2/2ms
01-17 09:39:48.131: I/jPCT-AE(24292): Compressing texture to ETC1...
01-17 09:39:48.131: I/jPCT-AE(24292): Loaded etc1_8_15343.tex from cache!
01-17 09:39:48.131: I/jPCT-AE(24292): ...done in 0/0ms
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on January 17, 2014, 08:32:39 am
The whole loading process takes, according to this log, 140ms. I fail to see how this should be noticable on resume... ???
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kkl on January 17, 2014, 11:46:51 am
Sorry Egon, that was part of the logs. I think I should show you the logs starting from beginning of resume:

Code: [Select]
01-17 18:39:38.106: I/jPCT-AE(12453): onCreate
01-17 18:39:38.106: I/jPCT-AE(12453): Copying data from master Activity!
01-17 18:39:38.281: I/jPCT-AE(12453): Initializing GL20 render pipeline...
01-17 18:39:38.286: I/jPCT-AE(12453): Loading default shaders !
01-17 18:39:38.286: I/jPCT-AE(12453): 0 shaders in replacement map!
01-17 18:39:38.286: I/jPCT-AE(12453): Default fragment shader is: /defaultFragmentShader.src
01-17 18:39:38.286: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.291: I/jPCT-AE(12453): Text file from InputStream loaded...2008 bytes
01-17 18:39:38.291: I/jPCT-AE(12453): Default vertex shader is: /defaultVertexShader.src
01-17 18:39:38.291: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.291: I/jPCT-AE(12453): Text file from InputStream loaded...4496 bytes
01-17 18:39:38.291: I/jPCT-AE(12453): Compiling shader program!
01-17 18:39:38.296: I/jPCT-AE(12453): Handles of 210003: 4/44/5
01-17 18:39:38.296: I/jPCT-AE(12453): Loading default shaders (Tex0)!
01-17 18:39:38.296: I/jPCT-AE(12453): 0 shaders in replacement map!
01-17 18:39:38.296: I/jPCT-AE(12453): Default fragment shader is: /defaultFragmentShader.src
01-17 18:39:38.301: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.301: I/jPCT-AE(12453): Text file from InputStream loaded...201 bytes
01-17 18:39:38.306: I/jPCT-AE(12453): Default vertex shader is: /defaultVertexShader.src
01-17 18:39:38.306: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.306: I/jPCT-AE(12453): Text file from InputStream loaded...4020 bytes
01-17 18:39:38.306: I/jPCT-AE(12453): Compiling shader program!
01-17 18:39:38.311: I/jPCT-AE(12453): Handles of 420006: 1/41/2
01-17 18:39:38.311: I/jPCT-AE(12453): Loading default shaders (Tex1)!
01-17 18:39:38.311: I/jPCT-AE(12453): 0 shaders in replacement map!
01-17 18:39:38.311: I/jPCT-AE(12453): Default fragment shader is: /defaultFragmentShader.src
01-17 18:39:38.311: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.311: I/jPCT-AE(12453): Text file from InputStream loaded...871 bytes
01-17 18:39:38.311: I/jPCT-AE(12453): Default vertex shader is: /defaultVertexShader.src
01-17 18:39:38.316: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.316: I/jPCT-AE(12453): Text file from InputStream loaded...4390 bytes
01-17 18:39:38.316: I/jPCT-AE(12453): Compiling shader program!
01-17 18:39:38.321: I/jPCT-AE(12453): Handles of 630009: 2/44/3
01-17 18:39:38.321: I/jPCT-AE(12453): Loading default shaders (Tex0Light0)!
01-17 18:39:38.321: I/jPCT-AE(12453): 0 shaders in replacement map!
01-17 18:39:38.321: I/jPCT-AE(12453): Default fragment shader is: /defaultFragmentShader.src
01-17 18:39:38.321: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.326: I/jPCT-AE(12453): Text file from InputStream loaded...201 bytes
01-17 18:39:38.326: I/jPCT-AE(12453): Default vertex shader is: /defaultVertexShader.src
01-17 18:39:38.326: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.326: I/jPCT-AE(12453): Text file from InputStream loaded...1293 bytes
01-17 18:39:38.331: I/jPCT-AE(12453): Compiling shader program!
01-17 18:39:38.331: I/jPCT-AE(12453): Handles of 840012: 1/11/2
01-17 18:39:38.331: I/jPCT-AE(12453): Loading default shaders (Fog)!
01-17 18:39:38.331: I/jPCT-AE(12453): 0 shaders in replacement map!
01-17 18:39:38.331: I/jPCT-AE(12453): Default fragment shader is: /defaultFragmentShader.src
01-17 18:39:38.336: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.336: I/jPCT-AE(12453): Text file from InputStream loaded...328 bytes
01-17 18:39:38.336: I/jPCT-AE(12453): Default vertex shader is: /defaultVertexShader.src
01-17 18:39:38.336: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.341: I/jPCT-AE(12453): Text file from InputStream loaded...4267 bytes
01-17 18:39:38.341: I/jPCT-AE(12453): Compiling shader program!
01-17 18:39:38.341: I/jPCT-AE(12453): Handles of 1050015: 1/44/2
01-17 18:39:38.341: I/jPCT-AE(12453): Loading default shaders (FogLight0)!
01-17 18:39:38.341: I/jPCT-AE(12453): 0 shaders in replacement map!
01-17 18:39:38.341: I/jPCT-AE(12453): Default fragment shader is: /defaultFragmentShader.src
01-17 18:39:38.346: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.346: I/jPCT-AE(12453): Text file from InputStream loaded...328 bytes
01-17 18:39:38.346: I/jPCT-AE(12453): Default vertex shader is: /defaultVertexShader.src
01-17 18:39:38.346: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.351: I/jPCT-AE(12453): Text file from InputStream loaded...1608 bytes
01-17 18:39:38.351: I/jPCT-AE(12453): Compiling shader program!
01-17 18:39:38.351: I/jPCT-AE(12453): Handles of 1260018: 1/15/2
01-17 18:39:38.351: I/jPCT-AE(12453): Loading default shaders (Tex0Amb)!
01-17 18:39:38.351: I/jPCT-AE(12453): 0 shaders in replacement map!
01-17 18:39:38.351: I/jPCT-AE(12453): Default fragment shader is: /defaultFragmentShader.src
01-17 18:39:38.351: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.351: I/jPCT-AE(12453): Text file from InputStream loaded...199 bytes
01-17 18:39:38.351: I/jPCT-AE(12453): Default vertex shader is: /defaultVertexShader.src
01-17 18:39:38.356: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.356: I/jPCT-AE(12453): Text file from InputStream loaded...757 bytes
01-17 18:39:38.356: I/jPCT-AE(12453): Compiling shader program!
01-17 18:39:38.361: I/jPCT-AE(12453): Handles of 1470021: 1/5/2
01-17 18:39:38.361: I/jPCT-AE(12453): Loading default shaders (Depth)!
01-17 18:39:38.361: I/jPCT-AE(12453): 0 shaders in replacement map!
01-17 18:39:38.361: I/jPCT-AE(12453): Default fragment shader is: /defaultFragmentShader.src
01-17 18:39:38.361: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.361: I/jPCT-AE(12453): Text file from InputStream loaded...745 bytes
01-17 18:39:38.361: I/jPCT-AE(12453): Default vertex shader is: /defaultVertexShader.src
01-17 18:39:38.361: I/jPCT-AE(12453): Loading file from InputStream
01-17 18:39:38.366: I/jPCT-AE(12453): Text file from InputStream loaded...248 bytes
01-17 18:39:38.366: I/jPCT-AE(12453): Compiling shader program!
01-17 18:39:38.366: I/jPCT-AE(12453): Handles of 1680024: 1/1/-1
01-17 18:39:38.366: I/jPCT-AE(12453): GL20 render pipeline initialized!
01-17 18:39:38.366: I/jPCT-AE(12453): OpenGL vendor:     Imagination Technologies
01-17 18:39:38.366: I/jPCT-AE(12453): OpenGL renderer:   PowerVR SGX 544MP
01-17 18:39:38.366: I/jPCT-AE(12453): OpenGL version:    OpenGL ES 2.0 build 1.10@2359475
01-17 18:39:38.366: I/jPCT-AE(12453): OpenGL renderer initialized (using 3 texture stages)
01-17 18:39:38.401: D/dalvikvm(12453): GC_FOR_ALLOC freed 2936K, 30% free 23690K/33712K, paused 26ms, total 26ms
01-17 18:39:38.401: I/jPCT-AE(12453): Visibility lists disposed!
01-17 18:39:38.421: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:38.851: I/jPCT-AE(12453): Loaded etc1_0_4123548221216.tex from cache!
01-17 18:39:38.851: I/jPCT-AE(12453): ...done in 433/2ms
01-17 18:39:38.861: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:38.951: I/jPCT-AE(12453): Loaded etc1_1_257776529543.tex from cache!
01-17 18:39:38.951: I/jPCT-AE(12453): ...done in 91/1ms
01-17 18:39:38.951: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:38.981: I/jPCT-AE(12453): Loaded etc1_2_16129588444.tex from cache!
01-17 18:39:38.981: I/jPCT-AE(12453): ...done in 27/1ms
01-17 18:39:38.981: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:38.991: I/jPCT-AE(12453): Loaded etc1_3_1011498809.tex from cache!
01-17 18:39:38.991: I/jPCT-AE(12453): ...done in 9/1ms
01-17 18:39:38.991: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:38.996: I/jPCT-AE(12453): Loaded etc1_4_64379363.tex from cache!
01-17 18:39:38.996: I/jPCT-AE(12453): ...done in 4/1ms
01-17 18:39:38.996: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:38.996: I/jPCT-AE(12453): Loaded etc1_5_4240592.tex from cache!
01-17 18:39:38.996: I/jPCT-AE(12453): ...done in 2/2ms
01-17 18:39:39.001: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.001: I/jPCT-AE(12453): Loaded etc1_6_345575.tex from cache!
01-17 18:39:39.001: I/jPCT-AE(12453): ...done in 3/2ms
01-17 18:39:39.001: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.001: I/jPCT-AE(12453): Loaded etc1_7_45756.tex from cache!
01-17 18:39:39.006: I/jPCT-AE(12453): ...done in 2/2ms
01-17 18:39:39.006: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.006: I/jPCT-AE(12453): Loaded etc1_8_19828.tex from cache!
01-17 18:39:39.006: I/jPCT-AE(12453): ...done in 2/2ms
01-17 18:39:39.031: D/dalvikvm(12453): GC_FOR_ALLOC freed 2212K, 28% free 24591K/33712K, paused 23ms, total 23ms
01-17 18:39:39.031: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.031: I/jPCT-AE(12453): Loaded etc1_9_16972.tex from cache!
01-17 18:39:39.031: I/jPCT-AE(12453): ...done in 2/1ms
01-17 18:39:39.031: I/jPCT-AE(12453): Recompiling shader because of context change!
01-17 18:39:39.031: I/jPCT-AE(12453): Compiling shader program!
01-17 18:39:39.036: I/jPCT-AE(12453): Handles of 1890027: 4/44/5
01-17 18:39:39.036: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.036: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.041: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.041: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.046: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.146: I/jPCT-AE(12453): Loaded etc1_0_257770371217.tex from cache!
01-17 18:39:39.146: I/jPCT-AE(12453): ...done in 98/2ms
01-17 18:39:39.146: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.171: I/jPCT-AE(12453): Loaded etc1_1_16127827525.tex from cache!
01-17 18:39:39.171: I/jPCT-AE(12453): ...done in 24/0ms
01-17 18:39:39.171: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.181: I/jPCT-AE(12453): Loaded etc1_2_1011031159.tex from cache!
01-17 18:39:39.181: I/jPCT-AE(12453): ...done in 7/0ms
01-17 18:39:39.181: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.181: I/jPCT-AE(12453): Loaded etc1_3_64252403.tex from cache!
01-17 18:39:39.181: I/jPCT-AE(12453): ...done in 3/0ms
01-17 18:39:39.181: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.181: I/jPCT-AE(12453): Loaded etc1_4_4210195.tex from cache!
01-17 18:39:39.186: I/jPCT-AE(12453): ...done in 1/1ms
01-17 18:39:39.186: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.186: I/jPCT-AE(12453): Loaded etc1_5_336056.tex from cache!
01-17 18:39:39.186: I/jPCT-AE(12453): ...done in 1/0ms
01-17 18:39:39.186: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.186: I/jPCT-AE(12453): Loaded etc1_6_42259.tex from cache!
01-17 18:39:39.186: I/jPCT-AE(12453): ...done in 1/1ms
01-17 18:39:39.186: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.186: I/jPCT-AE(12453): Loaded etc1_7_17453.tex from cache!
01-17 18:39:39.186: I/jPCT-AE(12453): ...done in 0/0ms
01-17 18:39:39.186: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.186: I/jPCT-AE(12453): Loaded etc1_8_15131.tex from cache!
01-17 18:39:39.186: I/jPCT-AE(12453): ...done in 1/1ms
01-17 18:39:39.186: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.186: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.216: D/dalvikvm(12453): GC_FOR_ALLOC freed 3247K, 31% free 23568K/33712K, paused 22ms, total 22ms
01-17 18:39:39.226: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.596: I/jPCT-AE(12453): Loaded etc1_0_4123540738510.tex from cache!
01-17 18:39:39.596: I/jPCT-AE(12453): ...done in 371/3ms
01-17 18:39:39.601: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.696: I/jPCT-AE(12453): Loaded etc1_1_257774338073.tex from cache!
01-17 18:39:39.696: I/jPCT-AE(12453): ...done in 94/1ms
01-17 18:39:39.701: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.726: I/jPCT-AE(12453): Loaded etc1_2_16128532852.tex from cache!
01-17 18:39:39.726: I/jPCT-AE(12453): ...done in 26/2ms
01-17 18:39:39.726: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.756: D/dalvikvm(12453): GC_FOR_ALLOC freed 1999K, 27% free 24641K/33712K, paused 21ms, total 21ms
01-17 18:39:39.756: I/jPCT-AE(12453): Loaded etc1_3_1011100967.tex from cache!
01-17 18:39:39.756: I/jPCT-AE(12453): ...done in 31/23ms
01-17 18:39:39.756: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.761: I/jPCT-AE(12453): Loaded etc1_4_64252694.tex from cache!
01-17 18:39:39.761: I/jPCT-AE(12453): ...done in 4/1ms
01-17 18:39:39.761: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.766: I/jPCT-AE(12453): Loaded etc1_5_4202930.tex from cache!
01-17 18:39:39.766: I/jPCT-AE(12453): ...done in 1/0ms
01-17 18:39:39.766: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.766: I/jPCT-AE(12453): Loaded etc1_6_333947.tex from cache!
01-17 18:39:39.766: I/jPCT-AE(12453): ...done in 1/1ms
01-17 18:39:39.766: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.766: I/jPCT-AE(12453): Loaded etc1_7_41815.tex from cache!
01-17 18:39:39.766: I/jPCT-AE(12453): ...done in 0/0ms
01-17 18:39:39.766: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.766: I/jPCT-AE(12453): Loaded etc1_8_18475.tex from cache!
01-17 18:39:39.766: I/jPCT-AE(12453): ...done in 1/0ms
01-17 18:39:39.766: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.771: I/jPCT-AE(12453): Loaded etc1_9_16782.tex from cache!
01-17 18:39:39.771: I/jPCT-AE(12453): ...done in 1/1ms
01-17 18:39:39.771: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.771: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.776: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.871: I/jPCT-AE(12453): Loaded etc1_0_257781532288.tex from cache!
01-17 18:39:39.871: I/jPCT-AE(12453): ...done in 96/1ms
01-17 18:39:39.876: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.901: I/jPCT-AE(12453): Loaded etc1_1_16130942465.tex from cache!
01-17 18:39:39.901: I/jPCT-AE(12453): ...done in 26/1ms
01-17 18:39:39.901: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.911: I/jPCT-AE(12453): Loaded etc1_2_1011851863.tex from cache!
01-17 18:39:39.911: I/jPCT-AE(12453): ...done in 8/1ms
01-17 18:39:39.911: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.911: I/jPCT-AE(12453): Loaded etc1_3_64468099.tex from cache!
01-17 18:39:39.911: I/jPCT-AE(12453): ...done in 2/1ms
01-17 18:39:39.911: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.911: I/jPCT-AE(12453): Loaded etc1_4_4264604.tex from cache!
01-17 18:39:39.916: I/jPCT-AE(12453): ...done in 2/1ms
01-17 18:39:39.916: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.916: I/jPCT-AE(12453): Loaded etc1_5_350879.tex from cache!
01-17 18:39:39.916: I/jPCT-AE(12453): ...done in 1/0ms
01-17 18:39:39.916: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.916: I/jPCT-AE(12453): Loaded etc1_6_46378.tex from cache!
01-17 18:39:39.916: I/jPCT-AE(12453): ...done in 1/1ms
01-17 18:39:39.916: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.916: I/jPCT-AE(12453): Loaded etc1_7_18736.tex from cache!
01-17 18:39:39.916: I/jPCT-AE(12453): ...done in 1/1ms
01-17 18:39:39.916: I/jPCT-AE(12453): Compressing texture to ETC1...
01-17 18:39:39.921: I/jPCT-AE(12453): Loaded etc1_8_15343.tex from cache!
01-17 18:39:39.921: I/jPCT-AE(12453): ...done in 1/1ms
01-17 18:39:39.921: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.921: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.921: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.921: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.931: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.931: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.951: D/dalvikvm(12453): GC_FOR_ALLOC freed 3893K, 31% free 23569K/33712K, paused 13ms, total 13ms
01-17 18:39:39.971: I/jPCT-AE(12453): Recompiling shader because of context change!
01-17 18:39:39.971: I/jPCT-AE(12453): Compiling shader program!
01-17 18:39:39.971: I/jPCT-AE(12453): Handles of 2100030: 4/44/5
01-17 18:39:39.971: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.971: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.976: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.976: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.976: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.981: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.981: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.981: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.981: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:39.981: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:39.996: D/dalvikvm(12453): GC_FOR_ALLOC freed 2737K, 31% free 23569K/33712K, paused 14ms, total 14ms
01-17 18:39:40.006: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.006: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:40.011: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.011: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:40.011: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.011: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:40.011: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.011: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:40.016: I/jPCT-AE(12453): [ 1389955180019 ] - WARNING: Texture's size is 128/8, but textures should be square for OpenGL ES2.0! This may result in a black texture!
01-17 18:39:40.016: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.016: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:40.016: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.016: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:40.016: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.016: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:40.016: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.016: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:40.016: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.016: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:40.021: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.021: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:40.021: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.021: I/jPCT-AE(12453): Creating buffers...
01-17 18:39:40.021: I/jPCT-AE(12453): OpenGL context has changed(2)...recovering for renderer 3/2!
01-17 18:39:40.021: I/jPCT-AE(12453): Creating buffers...

Seems like it loads a lot of compressed textures but I set compression on for only 7 textures. I'm using the Hello World project from JPCT.
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on January 17, 2014, 12:03:29 pm
The additional textures that it loads are the mip maps. If you are using some textures for blitting only, you can disable mip mapping for them to save the time and memory.

I'll have a look at the loading code later...

However, even with an in-memory cache of the etc version, i still need the raw texture data. Why are you compressing the textures anyway? Just because you can or because it won't work otherwise?
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kkl on January 17, 2014, 12:19:17 pm
in some devices, it returns 1285 glerror... Making textures smaller fixes that error.. I assume it's gl out of memory issue. But smaller texture makes the app looks bad..

if keeping etc1 cache and raw texture data at the same time, we might run into out of memory issue for main memory. Just out of curiosity, why do we still need the raw texture data when we have etc1 cache?
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on January 17, 2014, 12:25:46 pm
...to calculate a checksum for the cached file. This has to be done to keep the files between different runs of the app. For an in-memory cache, this wouldn't be needed, but it would require to add an alternative branch to the texture pipeline, which i'm trying to avoid.
I don't think that the 1285 error has anything to do with memory. It'a more likely that is has to do with mip map creation. Try to disable etc1 and set Config.internalMipmapCreation to true and see if that fixes the problem with the 1285 error.
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kkl on January 17, 2014, 03:03:02 pm
If we have in-memory cache, not only we can save more in main memory, but save memory in gpu too. I think it's a win-win solution with abit more effort to do it. I had many crash reports with my app due to out of memory issue. However, compressing it makes it look bad on resume (due to the stutter). It would be nice if we have both compressed data to reduce chances of memory issue to match industry standard as close as possible. What do you think?

I can't replicate back the 1285 error anymore. It happens pretty randomly, I think. I'll try use Config.internalMipmapCreation if I get back that error. Thanks alot on the solution.
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on January 17, 2014, 03:05:12 pm
I don't see why an in-memory cache will save memory on the GPU...?
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kkl on January 17, 2014, 03:19:44 pm
Correct me if I'm wrong. The GPU driver reads etc1 data directly as texture, isn't it? Hence, gpu stores only etc1 compressed data in its memory instead of uncompressing etc1 first and read the texture.
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on January 17, 2014, 10:07:48 pm
Yes, it reduces memory usage on the GPU but keeping an extra copy in memory increases main memory usage. However, i had a look at your log output and my code and the loading itself is dead cheap (1-2ms). What takes much more time is the copying from the actual texture data into the buffer that is used to create the texture in case that it can't be found in the cache. This code also calculates the checksum, which is why i can't omit it...i'll try to come up with something better...
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on January 17, 2014, 11:08:40 pm
Could you give this jar a try: http://jpct.de/download/beta/jpct_ae.jar (http://jpct.de/download/beta/jpct_ae.jar)? It doesn't include any kind of memory caching, but resume times should be better anyway. I would be interested in the log output of this one...
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kkl on January 18, 2014, 03:20:06 am
1-2ms? That's extremely fast, judging from file IO process. How many and how big are the textures in your case?

BTW, here's the log after using new jpct :
Code: [Select]
01-18 10:00:58.146: I/jPCT-AE(2265): Visibility lists disposed!
01-18 10:00:58.146: I/jPCT-AE(2265): [ 1390010458153 ] - WARNING: Unable to dispose gl related resources because the current context has changed!
01-18 10:00:58.146: I/jPCT-AE(2265): Renderer disposed!
01-18 10:00:58.146: I/jPCT-AE(2265): GL context is 1118286640
01-18 10:00:58.146: I/jPCT-AE(2265): Initializing GL20 render pipeline...
01-18 10:00:58.146: I/jPCT-AE(2265): Loading default shaders !
01-18 10:00:58.146: I/jPCT-AE(2265): 0 shaders in replacement map!
01-18 10:00:58.146: I/jPCT-AE(2265): Default fragment shader is: /defaultFragmentShader.src
01-18 10:00:58.151: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:58.151: I/jPCT-AE(2265): Text file from InputStream loaded...2416 bytes
01-18 10:00:58.151: I/jPCT-AE(2265): Default vertex shader is: /defaultVertexShader.src
01-18 10:00:58.151: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:58.151: I/jPCT-AE(2265): Text file from InputStream loaded...4496 bytes
01-18 10:00:58.151: I/jPCT-AE(2265): Compiling shader program!
01-18 10:00:58.891: I/jPCT-AE(2265): Handles of 210003: 4/44/5
01-18 10:00:58.891: I/jPCT-AE(2265): Loading default shaders (Tex0Amb)!
01-18 10:00:58.891: I/jPCT-AE(2265): 0 shaders in replacement map!
01-18 10:00:58.891: I/jPCT-AE(2265): Default fragment shader is: /defaultFragmentShader.src
01-18 10:00:58.891: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:58.891: I/jPCT-AE(2265): Text file from InputStream loaded...199 bytes
01-18 10:00:58.891: I/jPCT-AE(2265): Default vertex shader is: /defaultVertexShader.src
01-18 10:00:58.896: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:58.896: I/jPCT-AE(2265): Text file from InputStream loaded...757 bytes
01-18 10:00:58.896: I/jPCT-AE(2265): Compiling shader program!
01-18 10:00:58.921: I/jPCT-AE(2265): Handles of 420006: 1/5/2
01-18 10:00:58.926: I/jPCT-AE(2265): Loading default shaders (Tex0)!
01-18 10:00:58.926: I/jPCT-AE(2265): 0 shaders in replacement map!
01-18 10:00:58.926: I/jPCT-AE(2265): Default fragment shader is: /defaultFragmentShader.src
01-18 10:00:58.926: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:58.926: I/jPCT-AE(2265): Text file from InputStream loaded...201 bytes
01-18 10:00:58.926: I/jPCT-AE(2265): Default vertex shader is: /defaultVertexShader.src
01-18 10:00:58.926: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:58.926: I/jPCT-AE(2265): Text file from InputStream loaded...4020 bytes
01-18 10:00:58.926: I/jPCT-AE(2265): Compiling shader program!
01-18 10:00:58.936: I/jPCT-AE(2265): Handles of 630009: 1/41/2
01-18 10:00:58.936: I/jPCT-AE(2265): Loading default shaders (Tex1)!
01-18 10:00:58.936: I/jPCT-AE(2265): 0 shaders in replacement map!
01-18 10:00:58.936: I/jPCT-AE(2265): Default fragment shader is: /defaultFragmentShader.src
01-18 10:00:58.941: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:58.941: I/jPCT-AE(2265): Text file from InputStream loaded...997 bytes
01-18 10:00:58.941: I/jPCT-AE(2265): Default vertex shader is: /defaultVertexShader.src
01-18 10:00:58.941: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:58.941: I/jPCT-AE(2265): Text file from InputStream loaded...4390 bytes
01-18 10:00:58.941: I/jPCT-AE(2265): Compiling shader program!
01-18 10:00:59.251: I/jPCT-AE(2265): Handles of 840012: 2/44/3
01-18 10:00:59.251: I/jPCT-AE(2265): Loading default shaders (Tex0Light0)!
01-18 10:00:59.251: I/jPCT-AE(2265): 0 shaders in replacement map!
01-18 10:00:59.251: I/jPCT-AE(2265): Default fragment shader is: /defaultFragmentShader.src
01-18 10:00:59.251: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:59.251: I/jPCT-AE(2265): Text file from InputStream loaded...201 bytes
01-18 10:00:59.251: I/jPCT-AE(2265): Default vertex shader is: /defaultVertexShader.src
01-18 10:00:59.251: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:59.251: I/jPCT-AE(2265): Text file from InputStream loaded...1293 bytes
01-18 10:00:59.251: I/jPCT-AE(2265): Compiling shader program!
01-18 10:00:59.256: I/jPCT-AE(2265): Handles of 1050015: 1/11/2
01-18 10:00:59.256: I/jPCT-AE(2265): Loading default shaders (Fog)!
01-18 10:00:59.256: I/jPCT-AE(2265): 0 shaders in replacement map!
01-18 10:00:59.256: I/jPCT-AE(2265): Default fragment shader is: /defaultFragmentShader.src
01-18 10:00:59.256: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:59.256: I/jPCT-AE(2265): Text file from InputStream loaded...328 bytes
01-18 10:00:59.256: I/jPCT-AE(2265): Default vertex shader is: /defaultVertexShader.src
01-18 10:00:59.256: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:59.256: I/jPCT-AE(2265): Text file from InputStream loaded...4267 bytes
01-18 10:00:59.256: I/jPCT-AE(2265): Compiling shader program!
01-18 10:00:59.271: I/jPCT-AE(2265): Handles of 1260018: 1/44/2
01-18 10:00:59.271: I/jPCT-AE(2265): Loading default shaders (FogLight0)!
01-18 10:00:59.271: I/jPCT-AE(2265): 0 shaders in replacement map!
01-18 10:00:59.271: I/jPCT-AE(2265): Default fragment shader is: /defaultFragmentShader.src
01-18 10:00:59.271: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:59.276: I/jPCT-AE(2265): Text file from InputStream loaded...328 bytes
01-18 10:00:59.276: I/jPCT-AE(2265): Default vertex shader is: /defaultVertexShader.src
01-18 10:00:59.276: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:59.276: I/jPCT-AE(2265): Text file from InputStream loaded...1608 bytes
01-18 10:00:59.276: I/jPCT-AE(2265): Compiling shader program!
01-18 10:00:59.276: I/jPCT-AE(2265): Handles of 1470021: 1/15/2
01-18 10:00:59.276: I/jPCT-AE(2265): Loading default shaders (Depth)!
01-18 10:00:59.276: I/jPCT-AE(2265): 0 shaders in replacement map!
01-18 10:00:59.276: I/jPCT-AE(2265): Default fragment shader is: /defaultFragmentShader.src
01-18 10:00:59.276: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:59.276: I/jPCT-AE(2265): Text file from InputStream loaded...745 bytes
01-18 10:00:59.276: I/jPCT-AE(2265): Default vertex shader is: /defaultVertexShader.src
01-18 10:00:59.276: I/jPCT-AE(2265): Loading file from InputStream
01-18 10:00:59.281: I/jPCT-AE(2265): Text file from InputStream loaded...248 bytes
01-18 10:00:59.281: I/jPCT-AE(2265): Compiling shader program!
01-18 10:00:59.286: I/jPCT-AE(2265): Handles of 1680024: 1/1/-1
01-18 10:00:59.286: I/jPCT-AE(2265): GL20 render pipeline initialized!
01-18 10:00:59.286: I/jPCT-AE(2265): OpenGL vendor:     Imagination Technologies
01-18 10:00:59.286: I/jPCT-AE(2265): OpenGL renderer:   PowerVR SGX 544MP
01-18 10:00:59.286: I/jPCT-AE(2265): OpenGL version:    OpenGL ES 2.0 build 1.10@2359475
01-18 10:00:59.286: I/jPCT-AE(2265): OpenGL renderer initialized (using 3/8 texture stages)
01-18 10:00:59.316: D/dalvikvm(2265): GC_FOR_ALLOC freed 2709K, 29% free 23135K/32544K, paused 23ms, total 23ms
01-18 10:00:59.331: I/jPCT-AE(2265): Compressing texture (512*512) to ETC1...
01-18 10:00:59.331: I/jPCT-AE(2265): Creating byte buffer of size 786432
01-18 10:00:59.421: D/dalvikvm(2265): GC_FOR_ALLOC freed 64K, 21% free 25891K/32544K, paused 14ms, total 15ms
01-18 10:00:59.421: I/jPCT-AE(2265): Loaded etc1_0_4123721231787.tex from cache!
01-18 10:00:59.421: I/jPCT-AE(2265): ...done in 92/17ms
01-18 10:00:59.426: I/jPCT-AE(2265): Compressing texture (256*256) to ETC1...
01-18 10:00:59.426: I/jPCT-AE(2265): Creating byte buffer of size 196608
01-18 10:00:59.446: I/jPCT-AE(2265): Loaded etc1_1_257835499821.tex from cache!
01-18 10:00:59.446: I/jPCT-AE(2265): ...done in 19/1ms
01-18 10:00:59.446: I/jPCT-AE(2265): Compressing texture (128*128) to ETC1...
01-18 10:00:59.446: I/jPCT-AE(2265): Creating byte buffer of size 49152
01-18 10:00:59.451: I/jPCT-AE(2265): Loaded etc1_2_16140396311.tex from cache!
01-18 10:00:59.451: I/jPCT-AE(2265): ...done in 5/0ms
01-18 10:00:59.451: I/jPCT-AE(2265): Compressing texture (64*64) to ETC1...
01-18 10:00:59.451: I/jPCT-AE(2265): Creating byte buffer of size 12288
01-18 10:00:59.456: I/jPCT-AE(2265): Loaded etc1_3_1015172985.tex from cache!
01-18 10:00:59.456: I/jPCT-AE(2265): ...done in 1/0ms
01-18 10:00:59.456: I/jPCT-AE(2265): Compressing texture (32*32) to ETC1...
01-18 10:00:59.456: I/jPCT-AE(2265): Creating byte buffer of size 3072
01-18 10:00:59.456: I/jPCT-AE(2265): Loaded etc1_4_65050486.tex from cache!
01-18 10:00:59.456: I/jPCT-AE(2265): ...done in 0/0ms
01-18 10:00:59.456: I/jPCT-AE(2265): Compressing texture (16*16) to ETC1...
01-18 10:00:59.456: I/jPCT-AE(2265): Creating byte buffer of size 768
01-18 10:00:59.456: I/jPCT-AE(2265): Loaded etc1_5_4458828.tex from cache!
01-18 10:00:59.456: I/jPCT-AE(2265): ...done in 0/0ms
01-18 10:00:59.456: I/jPCT-AE(2265): Compressing texture (8*8) to ETC1...
01-18 10:00:59.456: I/jPCT-AE(2265): Creating byte buffer of size 192
01-18 10:00:59.456: I/jPCT-AE(2265): Loaded etc1_6_384069.tex from cache!
01-18 10:00:59.456: I/jPCT-AE(2265): ...done in 1/1ms
01-18 10:00:59.456: I/jPCT-AE(2265): Compressing texture (4*4) to ETC1...
01-18 10:00:59.456: I/jPCT-AE(2265): Creating byte buffer of size 48
01-18 10:00:59.456: I/jPCT-AE(2265): Loaded etc1_7_47774.tex from cache!
01-18 10:00:59.456: I/jPCT-AE(2265): ...done in 0/0ms
01-18 10:00:59.456: I/jPCT-AE(2265): Compressing texture (2*2) to ETC1...
01-18 10:00:59.456: I/jPCT-AE(2265): Creating byte buffer of size 12
01-18 10:00:59.456: I/jPCT-AE(2265): Loaded etc1_8_17371.tex from cache!
01-18 10:00:59.456: I/jPCT-AE(2265): ...done in 1/1ms
01-18 10:00:59.456: I/jPCT-AE(2265): Compressing texture (1*1) to ETC1...
01-18 10:00:59.456: I/jPCT-AE(2265): Creating byte buffer of size 3
01-18 10:00:59.456: I/jPCT-AE(2265): Loaded etc1_9_16473.tex from cache!
01-18 10:00:59.456: I/jPCT-AE(2265): ...done in 0/0ms
01-18 10:00:59.456: I/jPCT-AE(2265): Recompiling shader because of context change!
01-18 10:00:59.456: I/jPCT-AE(2265): Compiling shader program!
01-18 10:00:59.596: I/jPCT-AE(2265): Handles of 1890027: 4/44/5
01-18 10:00:59.596: I/jPCT-AE(2265): OpenGL context has changed(2)...recovering for renderer 3/2!
01-18 10:00:59.596: I/jPCT-AE(2265): Creating buffers...
01-18 10:00:59.606: I/jPCT-AE(2265): OpenGL context has changed(2)...recovering for renderer 3/2!
01-18 10:00:59.606: I/jPCT-AE(2265): Creating buffers...
01-18 10:00:59.626: D/dalvikvm(2265): GC_FOR_ALLOC freed 4274K, 30% free 23074K/32544K, paused 16ms, total 16ms
01-18 10:00:59.636: I/jPCT-AE(2265): Compressing texture (512*512) to ETC1...
01-18 10:00:59.636: I/jPCT-AE(2265): Creating byte buffer of size 786432
01-18 10:00:59.736: D/dalvikvm(2265): GC_FOR_ALLOC freed 2K, 21% free 25892K/32544K, paused 24ms, total 24ms
01-18 10:00:59.736: I/jPCT-AE(2265): Loaded etc1_0_4123694060866.tex from cache!
01-18 10:00:59.736: I/jPCT-AE(2265): ...done in 103/27ms
01-18 10:00:59.746: I/jPCT-AE(2265): Compressing texture (256*256) to ETC1...
01-18 10:00:59.746: I/jPCT-AE(2265): Creating byte buffer of size 196608
01-18 10:00:59.766: I/jPCT-AE(2265): Loaded etc1_1_257828553330.tex from cache!
01-18 10:00:59.766: I/jPCT-AE(2265): ...done in 22/1ms
01-18 10:00:59.771: I/jPCT-AE(2265): Compressing texture (128*128) to ETC1...
01-18 10:00:59.771: I/jPCT-AE(2265): Creating byte buffer of size 49152
01-18 10:00:59.776: I/jPCT-AE(2265): Loaded etc1_2_16138571164.tex from cache!
01-18 10:00:59.776: I/jPCT-AE(2265): ...done in 4/0ms
01-18 10:00:59.776: I/jPCT-AE(2265): Compressing texture (64*64) to ETC1...
01-18 10:00:59.776: I/jPCT-AE(2265): Creating byte buffer of size 12288
01-18 10:00:59.776: I/jPCT-AE(2265): Loaded etc1_3_1014702394.tex from cache!
01-18 10:00:59.776: I/jPCT-AE(2265): ...done in 1/0ms
01-18 10:00:59.776: I/jPCT-AE(2265): Compressing texture (32*32) to ETC1...
01-18 10:00:59.776: I/jPCT-AE(2265): Creating byte buffer of size 3072
01-18 10:00:59.776: I/jPCT-AE(2265): Loaded etc1_4_64925807.tex from cache!
01-18 10:00:59.776: I/jPCT-AE(2265): ...done in 0/0ms
01-18 10:00:59.776: I/jPCT-AE(2265): Compressing texture (16*16) to ETC1...
01-18 10:00:59.776: I/jPCT-AE(2265): Creating byte buffer of size 768
01-18 10:00:59.776: I/jPCT-AE(2265): Loaded etc1_5_4429662.tex from cache!
01-18 10:00:59.776: I/jPCT-AE(2265): ...done in 1/0ms
01-18 10:00:59.776: I/jPCT-AE(2265): Compressing texture (8*8) to ETC1...
01-18 10:00:59.776: I/jPCT-AE(2265): Creating byte buffer of size 192
01-18 10:00:59.776: I/jPCT-AE(2265): Loaded etc1_6_375737.tex from cache!
01-18 10:00:59.776: I/jPCT-AE(2265): ...done in 0/0ms
01-18 10:00:59.776: I/jPCT-AE(2265): Compressing texture (4*4) to ETC1...
01-18 10:00:59.776: I/jPCT-AE(2265): Creating byte buffer of size 48
01-18 10:00:59.776: I/jPCT-AE(2265): Loaded etc1_7_45876.tex from cache!
01-18 10:00:59.776: I/jPCT-AE(2265): ...done in 1/1ms
01-18 10:00:59.776: I/jPCT-AE(2265): Compressing texture (2*2) to ETC1...
01-18 10:00:59.776: I/jPCT-AE(2265): Creating byte buffer of size 12
01-18 10:00:59.781: I/jPCT-AE(2265): Loaded etc1_8_16936.tex from cache!
01-18 10:00:59.781: I/jPCT-AE(2265): ...done in 0/0ms
01-18 10:00:59.781: I/jPCT-AE(2265): Compressing texture (1*1) to ETC1...
01-18 10:00:59.781: I/jPCT-AE(2265): Creating byte buffer of size 3
01-18 10:00:59.781: I/jPCT-AE(2265): Loaded etc1_9_16473.tex from cache!
01-18 10:00:59.781: I/jPCT-AE(2265): ...done in 0/0ms
01-18 10:00:59.781: I/jPCT-AE(2265): OpenGL context has changed(2)...recovering for renderer 3/2!
01-18 10:00:59.781: I/jPCT-AE(2265): Creating buffers...
01-18 10:00:59.796: D/dalvikvm(2265): GC_FOR_ALLOC freed 4144K, 30% free 23074K/32544K, paused 13ms, total 13ms
01-18 10:00:59.801: I/jPCT-AE(2265): Compressing texture (512*512) to ETC1...
01-18 10:00:59.801: I/jPCT-AE(2265): Creating byte buffer of size 786432
01-18 10:00:59.886: D/dalvikvm(2265): GC_FOR_ALLOC freed 2K, 21% free 25892K/32544K, paused 16ms, total 16ms
01-18 10:00:59.886: I/jPCT-AE(2265): Loaded etc1_0_4123713749042.tex from cache!
01-18 10:00:59.886: I/jPCT-AE(2265): ...done in 84/19ms
01-18 10:00:59.891: I/jPCT-AE(2265): Compressing texture (256*256) to ETC1...
01-18 10:00:59.891: I/jPCT-AE(2265): Creating byte buffer of size 196608
01-18 10:00:59.911: I/jPCT-AE(2265): Loaded etc1_1_257833308256.tex from cache!
01-18 10:00:59.911: I/jPCT-AE(2265): ...done in 19/1ms
01-18 10:00:59.911: I/jPCT-AE(2265): Compressing texture (128*128) to ETC1...
01-18 10:00:59.911: I/jPCT-AE(2265): Creating byte buffer of size 49152
01-18 10:00:59.916: I/jPCT-AE(2265): Loaded etc1_2_16139342772.tex from cache!
01-18 10:00:59.916: I/jPCT-AE(2265): ...done in 6/1ms
01-18 10:00:59.921: I/jPCT-AE(2265): Compressing texture (64*64) to ETC1...
01-18 10:00:59.921: I/jPCT-AE(2265): Creating byte buffer of size 12288
01-18 10:00:59.921: I/jPCT-AE(2265): Loaded etc1_3_1014775409.tex from cache!
01-18 10:00:59.921: I/jPCT-AE(2265): ...done in 2/0ms
01-18 10:00:59.921: I/jPCT-AE(2265): Compressing texture (32*32) to ETC1...
01-18 10:00:59.921: I/jPCT-AE(2265): Creating byte buffer of size 3072
01-18 10:00:59.921: I/jPCT-AE(2265): Loaded etc1_4_64925054.tex from cache!
01-18 10:00:59.921: I/jPCT-AE(2265): ...done in 1/1ms
01-18 10:00:59.921: I/jPCT-AE(2265): Compressing texture (16*16) to ETC1...
01-18 10:00:59.921: I/jPCT-AE(2265): Creating byte buffer of size 768
01-18 10:00:59.921: I/jPCT-AE(2265): Loaded etc1_5_4421730.tex from cache!
01-18 10:00:59.921: I/jPCT-AE(2265): ...done in 1/1ms
01-18 10:00:59.921: I/jPCT-AE(2265): Compressing texture (8*8) to ETC1...
01-18 10:00:59.921: I/jPCT-AE(2265): Creating byte buffer of size 192
01-18 10:00:59.921: I/jPCT-AE(2265): Loaded etc1_6_372702.tex from cache!
01-18 10:00:59.921: I/jPCT-AE(2265): ...done in 1/1ms
01-18 10:00:59.926: I/jPCT-AE(2265): Compressing texture (4*4) to ETC1...
01-18 10:00:59.926: I/jPCT-AE(2265): Creating byte buffer of size 48
01-18 10:00:59.926: I/jPCT-AE(2265): Loaded etc1_7_44506.tex from cache!
01-18 10:00:59.926: I/jPCT-AE(2265): ...done in 0/0ms
01-18 10:00:59.926: I/jPCT-AE(2265): Compressing texture (2*2) to ETC1...
01-18 10:00:59.926: I/jPCT-AE(2265): Creating byte buffer of size 12
01-18 10:00:59.926: I/jPCT-AE(2265): Loaded etc1_8_16623.tex from cache!
01-18 10:00:59.926: I/jPCT-AE(2265): ...done in 1/1ms
01-18 10:00:59.926: I/jPCT-AE(2265): Compressing texture (1*1) to ETC1...
01-18 10:00:59.926: I/jPCT-AE(2265): Creating byte buffer of size 3
01-18 10:00:59.926: I/jPCT-AE(2265): Loaded etc1_9_16473.tex from cache!
01-18 10:00:59.926: I/jPCT-AE(2265): ...done in 0/0ms
01-18 10:00:59.926: I/jPCT-AE(2265): OpenGL context has changed(2)...recovering for renderer 3/2!
01-18 10:00:59.926: I/jPCT-AE(2265): Creating buffers...
01-18 10:00:59.946: D/dalvikvm(2265): GC_FOR_ALLOC freed 4144K, 30% free 23074K/32544K, paused 16ms, total 16ms
01-18 10:00:59.956: I/jPCT-AE(2265): Compressing texture (512*512) to ETC1...
01-18 10:00:59.956: I/jPCT-AE(2265): Creating byte buffer of size 786432
01-18 10:01:00.061: D/dalvikvm(2265): GC_FOR_ALLOC freed 2K, 21% free 25892K/32544K, paused 18ms, total 18ms
01-18 10:01:00.061: I/jPCT-AE(2265): Loaded etc1_0_4123738728105.tex from cache!
01-18 10:01:00.061: I/jPCT-AE(2265): ...done in 109/21ms
01-18 10:01:00.071: I/jPCT-AE(2265): Compressing texture (256*256) to ETC1...
01-18 10:01:00.071: I/jPCT-AE(2265): Creating byte buffer of size 196608
01-18 10:01:00.091: I/jPCT-AE(2265): Loaded etc1_1_257840545329.tex from cache!
01-18 10:01:00.091: I/jPCT-AE(2265): ...done in 23/0ms
01-18 10:01:00.096: I/jPCT-AE(2265): Compressing texture (128*128) to ETC1...
01-18 10:01:00.096: I/jPCT-AE(2265): Creating byte buffer of size 49152
01-18 10:01:00.101: I/jPCT-AE(2265): Loaded etc1_2_16141751266.tex from cache!
01-18 10:01:00.101: I/jPCT-AE(2265): ...done in 6/0ms
01-18 10:01:00.101: I/jPCT-AE(2265): Compressing texture (64*64) to ETC1...
01-18 10:01:00.101: I/jPCT-AE(2265): Creating byte buffer of size 12288
01-18 10:01:00.106: I/jPCT-AE(2265): Loaded etc1_3_1015526905.tex from cache!
01-18 10:01:00.106: I/jPCT-AE(2265): ...done in 5/1ms
01-18 10:01:00.106: I/jPCT-AE(2265): Compressing texture (32*32) to ETC1...
01-18 10:01:00.106: I/jPCT-AE(2265): Creating byte buffer of size 3072
01-18 10:01:00.111: I/jPCT-AE(2265): Loaded etc1_4_65140124.tex from cache!
01-18 10:01:00.111: I/jPCT-AE(2265): ...done in 2/1ms
01-18 10:01:00.111: I/jPCT-AE(2265): Compressing texture (16*16) to ETC1...
01-18 10:01:00.111: I/jPCT-AE(2265): Creating byte buffer of size 768
01-18 10:01:00.111: I/jPCT-AE(2265): Loaded etc1_5_4483328.tex from cache!
01-18 10:01:00.111: I/jPCT-AE(2265): ...done in 1/0ms
01-18 10:01:00.111: I/jPCT-AE(2265): Compressing texture (8*8) to ETC1...
01-18 10:01:00.111: I/jPCT-AE(2265): Creating byte buffer of size 192
01-18 10:01:00.111: I/jPCT-AE(2265): Loaded etc1_6_389069.tex from cache!
01-18 10:01:00.111: I/jPCT-AE(2265): ...done in 1/1ms
01-18 10:01:00.111: I/jPCT-AE(2265): Compressing texture (4*4) to ETC1...
01-18 10:01:00.111: I/jPCT-AE(2265): Creating byte buffer of size 48
01-18 10:01:00.116: I/jPCT-AE(2265): Loaded etc1_7_49068.tex from cache!
01-18 10:01:00.116: I/jPCT-AE(2265): ...done in 2/1ms
01-18 10:01:00.116: I/jPCT-AE(2265): Compressing texture (2*2) to ETC1...
01-18 10:01:00.116: I/jPCT-AE(2265): Creating byte buffer of size 12
01-18 10:01:00.116: I/jPCT-AE(2265): Loaded etc1_8_17611.tex from cache!
01-18 10:01:00.116: I/jPCT-AE(2265): ...done in 1/0ms
01-18 10:01:00.116: I/jPCT-AE(2265): Compressing texture (1*1) to ETC1...
01-18 10:01:00.116: I/jPCT-AE(2265): Creating byte buffer of size 3
01-18 10:01:00.116: I/jPCT-AE(2265): Loaded etc1_9_16473.tex from cache!
01-18 10:01:00.116: I/jPCT-AE(2265): ...done in 1/1ms
01-18 10:01:00.116: I/jPCT-AE(2265): OpenGL context has changed(2)...recovering for renderer 3/2!
01-18 10:01:00.116: I/jPCT-AE(2265): Creating buffers...
01-18 10:01:00.126: I/jPCT-AE(2265): OpenGL context has changed(2)...recovering for renderer 3/2!
01-18 10:01:00.126: I/jPCT-AE(2265): Creating buffers...
01-18 10:01:00.136: I/jPCT-AE(2265): OpenGL context has changed(2)...recovering for renderer 3/2!
01-18 10:01:00.136: I/jPCT-AE(2265): Creating buffers...



Seems alot faster than previous, but the stutter still noticeable, just that it's shorter time. IMHO, if user chooses for sdcard caching, then we keep the raw texture data for checksum and backup. If user chooses for in-memory caching, then the raw texture data can be removed permanently. How about that? btw, is there any way to check the time taken for the gpu driver to process etc1?
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on January 18, 2014, 03:32:58 pm
The time used to process the actual data is the second number in the "...done in (...)" outputs. The first one is the buffer processing. That number went down from 1.4 sec to 0.5 sec in total with the latest change. As you may have noticed, i somehow don't like the idea of this memory caching. I think that optimizing the current process is the better idea and i have one idea left that might help to get rid of this buffer processing in most cases. I'll report back when i tried that...
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kkl on January 18, 2014, 04:17:10 pm
Yea sure, would love to hear from you soon.

I do notice you are not fond of in-memory caching, but I hope I can convince you too. I read an article about etc1 compression, and it saves a whole lot bunch of memory http://software.intel.com/en-us/articles/android-texture-compression (http://software.intel.com/en-us/articles/android-texture-compression). It tempted me so much till I can't resist thinking of using it. If JPCT is open-sourced, I'd love to help on this part  ; )
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: EgonOlsen on January 18, 2014, 09:02:59 pm
It's just that caching the etc1 data in memory seems like the wrong solution to me...i can't tell exactly why. Anyway, try this jar: http://jpct.de/download/beta/jpct_ae.jar (http://jpct.de/download/beta/jpct_ae.jar)
Title: Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
Post by: kkl on January 19, 2014, 03:31:41 pm
Yes, it's alot faster now. I can barely see the stutter, even though there is still a very short stutter. Hopefully that short one is the driver trying to process the etc1. Thanks alot for your help on improving the caching. Anyway, I still look forward to in-memory caching in the future if you change your mind ; )