Jump to content

rmbennin
 Share

Recommended Posts

Hello everyone,

 

I've looked over all the forums and help docs for how to include a background image for my Phaser game, but for some reason mine isn't working. I keep getting this error repeatedly:

 

"WebGL: drawElements: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete'. Or the texture is Float or Half Float type with linear filtering while OES_float_linear or OES_half_float_linear extension is not enabled. "

 

 

I have this code in preload():

game.load.image("background", "assets/background.jpg");

And this code in create():

background = game.add.tileSprite(0, 0, 1000, 600, "background");

Any help would be appreciated... Thanks!

Link to comment
Share on other sites

The clue is in the error - it's basically complaining that you're not using a power of 2 sized texture (something like 1024x512) - from what I've seen this is quite a GPU specific error, I certainly don't see it on my main work PC for example, but it's not a bad habit to get in to using ^2 texture sizes.

Link to comment
Share on other sites

The clue is in the error - it's basically complaining that you're not using a power of 2 sized texture (something like 1024x512) - from what I've seen this is quite a GPU specific error, I certainly don't see it on my main work PC for example, but it's not a bad habit to get in to using ^2 texture sizes.

 

Thank you so much! I was so confused at what that meant. I'm new to programming and can be dumb about some stuff!

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...

Has this issue been fixed in phaser v2.0.5? I'm running into this on my desktop Chrome browser using texture atlas. in IE 11 it works fine. 

 

[update]: I think this may not be a power of 2 issue. I tried just cropping the [32,32] region of my atlas at [0,0] but still getting the error.

Link to comment
Share on other sites

Hmm.. So I just saw this example that uses texture atlas for tiling. It's exactly just like my code but it works. I even downloaded the .png and .json to try with my project, it loaded the octopus and tiled correctly. I'm beginning to think that there's something wrong with my .png. I downloaded it from opengameart and manually created a json file for it. The json should be ok though as I can load a normal sprite without errors. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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