Author Topic: Could i use pre-compressed ETC1 texture file in jPCT-AE?  (Read 7335 times)

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
Could i use pre-compressed ETC1 texture file in jPCT-AE?
« 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...);
« Last Edit: April 18, 2013, 06:06:11 am by kiffa »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #1 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. 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.

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #2 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.

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #3 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #4 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.

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #5 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.
« Last Edit: January 15, 2014, 04:56:15 pm by kkl »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #6 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?

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #7 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.
« Last Edit: January 16, 2014, 03:28:38 pm by kkl »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #8 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) here, not about 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?

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #9 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #10 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... ???

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #11 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.
« Last Edit: January 17, 2014, 11:50:53 am by kkl »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #12 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?

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #13 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Could i use pre-compressed ETC1 texture file in jPCT-AE?
« Reply #14 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.