[devel] Roadmap 0.99.5 - update

Original link: http://www.cnblogs.com/yang3wei/archive/2012/03/07/2739875.html

Reprinted from: http://www.cocos2d-iphone.org/forum/topic/8073

  1. Roadmap updated:
    http://www.cocos2d-iphone.org/wiki/doku.php/roadmap

    Added:
    a) vfp/ Neon ARM support: to be included in CCSpriteBatchNode and CCNode
    Discussed here: http://www.cocos2d-iphone.org/forum/topic/3979

    b) PVR Non Compressed textures support
    discussed here: http://www.cocos2d-iphone.org/forum/topic/5984

    I've just downloaded the PVR SDK ( http://www.imgtec.com/powervr/insider/powervr-login.asp?SDK=iphone3gsOGLES2 ) and it includes the PVR texture format, and also the binaries work on Mac.

    So, v0.99.5 will add some features like CCAnimationCache, but the idea is to have an even faster cocos2d
    - MUCH faster texture loading times
    - Faster sprite transformations

    POSTED 1 YEAR AGO  #
  2. Support for Non-Compressed textures in PVR already implemented in "develop" branch.

    How to try it:
    - Download PVRTexTool (or the full SDK) from http://www.imgtec.com

    Added several samples in tests/Texture2dTest.m

    I've not done performance test yet, but I guess that the loading speed should be between 2x and 4x.

    POSTED 1 YEAR AGO  #
  3. Some performance tests taken from an iPad:

    --- PNG 1024x1024 ---
    RGBA 8888  ms:0.135391
    RGBA 4444  ms:0.140457
    RGBA 5551  ms:0.139977
    RGB 565  ms:0.137931
    --- PVR 1024x1024 ---
    RGBA 4444  ms:0.039912
    
    --- PNG 2048x2048 ---
    RGBA 8888  ms:0.530320
    RGBA 4444  ms:0.553548
    RGBA 5551  ms:0.553078
    RGB 565  ms:0.555968
    --- PVR 2048x2048 ---
    RGBA 4444  ms:0.161326

    lets image that you have to load 4 1024x1024 PNG images in RGBA 4444 in your game.
    It would take 0.14 * 4 = 0.56 seconds.

    but if you need more performance, perhaps because you need to load the texture in runtime, you can use PVR files.
    It would take 0.04 * 4= 0.16 seconds.... this is super fast! This is a 4x performance improvement.

    Features and limitations:
    + ultra super fast texture creation.
    - binary size is bigger since the files are not compressed. The files are stored in "texture format", and not in "image format".
    -/+: the created textures don't have the alpha channel premultiplied. This might cause a few more context switches, but then, the default blending function could be changed.

    FAQ:

    PVR != PVRTC. PVRTC == PVR Texture Compress , and PVRTC is one of the many supported formats by PVR.
    These are the PVR formats supported by cocos2d v0.99.5:
    - PVRTC 2bpp (since v0.6)
    - PVRTC 4bpp (since v0.6)
    - RGBA 8888
    - BGRA 8888
    - RGBA 4444
    - RGBA 5551
    - RGB 565
    - A8
    - I8
    - AI88

    POSTED 1 YEAR AGO  #
  4. I remember there being a thread a while ago that cocos2d requires twice the amount of memory while loading a file due to how loading works. How about PVR files? I could image these do not have this issue?

    POSTED 1 YEAR AGO  #
  5. @hactar: memory is alloced just once, and then it is sent directly to the texture memory. No double or triple mallocs are needed.

    Once the texture is generated, both "pvr" and "standard" images occupy the same amount of memory.

    POSTED 1 YEAR AGO  #
  6. Definitely looking forward to using the new pvr support. Thanks riq.

    POSTED 1 YEAR AGO  #
  7. Any specific settings you are using in the PVRTexTool when saving as the new uncompressed pvr. I'm using the GUI version.

    POSTED 1 YEAR AGO  #
  8. Yes, I should have mentioned that you MUST:
    - Vertically Flip disabled
    - NPOT texture are not supported (eg: 65x200 -> resize it manually to 128x256 before using PVRTexTool)
    - RGB 888 is not supported (use RGBA 8888 or RGB 565 instead)

    Mipmaps images are supported.

    POSTED 1 YEAR AGO  #
  9. Update:

    If you are ONLY using PVR images in your game, then I suggest this change in ccConfig.h:

    #define CC_OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA 1   // <-- SHOULD BE 0

    As I said, disable it ONLY if you are going to ONLY use PVR images. It won't work if you use 99% of PVR images, and 1% of PNG images. The PNG images won't render correctly.

    POSTED 1 YEAR AGO  #
  10. Great, I was able to get some of my own png to uncompressed pvr to load up in the tests provided.

    Now to try and figure out how to just pull out the necessary pieces of code for this to try and use it in my own project.

    POSTED 1 YEAR AGO  #
  11. As for this: -/+: the created textures don't have the alpha channel premultiplied. This might cause a few more context switches, but then, the default blending function could be changed.

    There is a preprocess option in the PVRTexTool GUI that says it applies premultiplied alpha, perhaps that would fix that up? Haven't tested it myself since I don't have images where I can really tell.

    POSTED 1 YEAR AGO  #
  12. There is a preprocess option in the PVRTexTool GUI that says it applies premultiplied alpha, perhaps that would fix that up? Haven't tested it myself since I don't have images where I can really tell.

    @gogokodo: great... I didn't know about that option.
    Where is it ? Is it available on the GUI ?

    Updated: never mind, I found it.

    POSTED 1 YEAR AGO  #
  13. unrealaz
    Member

    Did you guys find how to process multiple files at the same time? like all pngs in a dir..?

    POSTED 1 YEAR AGO  #
  14. @unrealaz: Probably you should create a bash script, and run the command line tool.

    POSTED 1 YEAR AGO  #
  15. Is there a way on mac os to generate non compressed pvr textures on osx ?

    [edit] I thought PVRTexTool was windows only but it seems there is an os x support. Will look at this.

    POSTED 1 YEAR AGO  #

Reproduced in: https: //www.cnblogs.com/yang3wei/archive/2012/03/07/2739875.html

Guess you like

Origin blog.csdn.net/weixin_30599769/article/details/94782770