Jump to content

Phaser 2.7+ and Atlas Compression Questions


Edricus
 Share

Recommended Posts

So I've been looking into the new updates to Phaser CE (2.7.0+) and what has caught my eye the most is the updates to the way Phaser handles textures. It now seems to have the ability to handle texture compression formats for WebGL which is exciting! Previous to this, all the games I had worked in were just loading PNG RGBA data into the graphics card and having come from other engines that support texture compression for GPU RAM optimizations, it was definitely a feature I missed.

I've branched on an old project I had in order to test this new compression system but I'm not sure how it would work with atlases. I was already using Texture Packer before to generate Texture Atlases for the game but they were just PNG atlases. I came across this Advanced Rendering Tutorial where it explains how to set up your Texture Packer project. I've gone ahead and done that but the examples only show the ability to load an image with those compression settings. Here is a doc reference to the load image function.

Currently, I am using 

this.game.load.atlasJSONHash('key', 'texturePNGURL', 'jsonURL');

It seems the new update only supports the following two calls

this.game.load.image('factory', {
    etc1: 'assets/factory_etc1.pkm',
    s3tc: 'assets/factory_dxt1.pvr',
    pvrtc: 'assets/factory_pvrtc.pvr',
    truecolor: 'assets/factory.png'
});

this.game.load.texture('factory', {
    etc1: 'assets/factory_etc1.pkm',
    s3tc: 'assets/factory_dxt1.pvr',
    pvrtc: 'assets/factory_pvrtc.pvr',
    truecolor: 'assets/factory.png'
});

How would I go about loading my atlases with the accompanying JSON information using the new compression system?

Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

I have the same issue. I'm using texture packer to make the atlas, the json file makes a reference to the image as a .pvr, but I don't really know if this is enough. I am sure I'm using WebGL, and as the docs say, truecolor will be used if the navigator doesn't support WebGL or if it doesn't have a GPU. So, I tested it, and if I remove the png file nothing works, so I assume I am still using the .png file.

So, the same question as above, how do I use the pvr data while is a canvas?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...