Handy tip for those using PVRTC textures

Discussion in 'Public Game Developers Forum' started by slembcke, Jul 22, 2009.

  1. Double click your app target to pull up it's settings. Then add a custom rule like so:
    [​IMG]

    Not sure how many people really use PVRTC textures, but this saves quite a bit of time. Instead of generating the textures on the command line every time, just add the source image files (yes it even works with PSDs) to your project and it will generate them at build time if they are needed or need to be regenerated. The rule swaps the generated file for the original automagically so you won't actually be adding your multi-megabyte layered PSD files to your app.

    Enjoy!
     
  2. Anders

    Anders Well-Known Member

    Feb 3, 2009
    1,634
    0
    0
    Co-owner and CTO at Color Monkey
    Sweden
    We use compressed textures, but I convert them manually ;)

    Is it possible to only convert in a certain dir (instead of all files in all dirs)? Also, is it possible to match several file types (i.e. *.png *.jpg)?
     
  3. The filter is just a glob, so you can make it match whatever. You can also put more than one pattern in if you separate it by a space. You can't have it just run it on certain directories, but you can get the same effect by tagging the name in some way. For instance say you want it to convert "image-pvr.png" and "image-pvr.jpg" but not "image.png" and "image.jpg". Then you would use "*-pvr.png *-pvr.jpg" as your pattern.
     
  4. Anders

    Anders Well-Known Member

    Feb 3, 2009
    1,634
    0
    0
    Co-owner and CTO at Color Monkey
    Sweden
    Great, thanks a lot! Will try it on Monday.
     
  5. Found out from somebody that there is an issue with spaces in the names. You need to put quotes around the filenames in the shell command (but not in the filename box).

    Code:
    /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool --bits-per-pixel-4 -e PVRTC -o "$BUILD_DIR/$INPUT_FILE_BASE.pvrtc" "$INPUT_FILE_PATH"
    I though sh split tokens then substituted variables, but apparently not. Enjoy.
     

Share This Page