Results 1 to 5 of 5

Thread: ClanLib 0.9 Texture Packer

  1. #1
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default ClanLib 0.9 Texture Packer

    ClanLib 0.9 has a utility which loads a resource file, and packs all the sprite graphics it can find into a set of tightly packed textures, and writes the result to a new resource file.

    Here is an example of loading all the 158 images used in ClanGUI, and how the resulting packed texture looks like:
    http://esoteric.clanlib.org/~sphair/texture_packer6.png

    This really helps performance, as the ClanLib now can batch all the sprite drawing commands efficiently, as it won't have to change the texture state.

  2. #2

    Default

    This is impressive, does this create an definitions file? Aka an XML file that defines where all the different textures are loaded on the image? If you don't get the boundaries correct then you have problems.

    I'm still using 0.8 because I need as much stability as possible. I should probably test 0.9 out though.

    *edit*
    I wrote a similar command line app when I used only SDL that did the same thing, however it was severely limited.

  3. #3
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    It loads a ClanLib resource file (xml), which consists of any number of individual images. Then it packs them into one or more textures (depending on if they fit within the selected texture size), and then dumps out new texture PNGs together with a new Resource XML with the proper locations.

  4. #4

    Default

    Does this tool retain the alpha transparency? For my purpose I need the alpha to be kept when writing the combined file.

    Is there somewhere I can get a compiled .EXE of the tool? I can't seem to make one that will compile myself.

    Thanks!

  5. #5
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    Yes, it handles alpha values.

    We will probably not provide executable for this. The tool was coded to enable us to pack our GUI textures. It will work for all generic cases, but the UI isn't complete and there is no option to actually select which resource file to convert yet. You have to change the code in MainWindow::load_resources() for that.

    What kind of compilation problems do you get? If you have a working ClanLib 2.0.x it should compile. If not, tell us the details.

Similar Threads

  1. ClanLib 0.9, texelcenter and texture rotation problems
    By wizardofoz in forum ClanLib: Developer Chat
    Replies: 9
    Last Post: 11-17-2008, 11:00 PM
  2. relationship between GC and Texture?
    By logixoul in forum ClanLib: Developer Chat
    Replies: 4
    Last Post: 07-07-2008, 07:17 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •