Jump to content

Phaser CE 2.7.0 - Multi Texture Batching


Matthias Elephant
 Share

Recommended Posts

Hi all,

i tested the new Phaser CE Version (2.7.0) with the Multi Texture Batching (http://phaser.io/tutorials/advanced-rendering-tutorial/part3).

Quote

var config = {
      width: 800,
      height: 600,
      renderer: Phaser.AUTO,
      antialias: true,
      multiTexture: true
};

var game = new Phaser.Game(config);

 

After some tests on PC (Chrome, FF) i build my app (cocoon) and tried it on some android devices.

On one of my test devices (Samsung Galaxy Nexus I9250) i just got a black screen (only if "multiTexture: true"). Without multiTexture, WebGL works without any problems.

On Phone (Browser): Crap! WebGL was blocked.

Remote Debugger output:

MTB_270_Phaser.PNG

What you think about?

Greetings

Link to comment
Share on other sites

Hi,

Sorry but this isn't designed for use within Cocoon apps (which already do their own thing re: WebGL)

As for in browser more details are needed - did you get a chance to try it with just a simple app for example? (something that just loads an image and makes a Sprite) - does that fail too, or is it only when put into your game? (trying to determine if it's a browser + device issue across the board, or an implementation)

Link to comment
Share on other sites

Hi,

attached you will find a simple example.

That is the result, when i open it on chrome (54.0.2840.85) on my android phone. Output is from remote debugging.

chrome_remotedebugging.PNG

 

I'm not sure what you mean with "not designed for use within Cocoon apps". What is the background about this? I think we can get a pretty good performance with the multi texture batching also on mobile.

At mentioned i testet several devices. Just problems with this one. Other devies works well with it.

test.zip

Link to comment
Share on other sites

Assuming the error in the screen shot is accurate, and not Chrome being misleading, then it tells the tale: The combined size of the textures you're trying to use in parallel are too large for the memory available on that GPU. So while it can support that many multiple textures (which is good), you've run the GPU out of memory in the process.

Link to comment
Share on other sites

Hi @rich,

thank you for your response. I read about the MTB in the tutorial. There is the following statement about the texture units.

If your the array you pass to the method has 12 elements in it, but the GPU only supports 8 texture units, then Phaser will just bind the first 7, and ignore the rest.
On more powerful devices, if the GPU supports 16 textures, it will bind them all, and your entire scene will render in one single draw call.
Phaser reserves 1 texture as a 'swap texture', the rest are entirely free for use though.


Now i understand that the number of texture units is not related to the memory of the GPU. Is that correct?

So how to be sure, that my texture are not to big for the GPU? I use the same textures in Phaser 2.6.2 with WebGl (in cocoon) and it works fine.

Texture are build with texturepacker (po2 - max 2048x2048)
 

I switched the Phaser version again (same textures) to 2.7.1 but without MTB usage and i got the same errors. So it seems to be no problem related with MTB.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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