-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to load compressed textures #162
Comments
Are you seeing this problem? Loader stalls when requesting PVR texture |
Yes, that is exactly what I am seeing. The debug output on that sample shows the |
The truecolor file (png) loads normally. The compressed texture (pvr) is in the queue and https://samme.github.io/phaser-examples-mirror/texture-compression/example.html seems to have the same problem. @photonstorm can you advise? |
@samme Did you take a look at the line number I linked? There's no network request because the check for |
Yes, I expected it would load compressed textures elsewhere, maybe by XHR instead of an image tag, but I don't see anything like that. I think I'm confused since this must have worked at some point. |
Hi @goldfire can you try phaser-test.js.zip? |
It does successfully load the files now; however, I'm not able to get anything from these files to render on screen. I'm still not sure if that is a separate issue or if I'm just doing something wrong. Will dig into it some more in the morning. |
@samme Okay, so I discovered the first issue was that our webpack setup adds query strings to the files, which was breaking the extension type extraction. I've opened a PR to fix that at #166. However, that is now causing the following error to be thrown when trying to load the compressed textures (inside of
|
That's only when using query string URLs? |
No, that is without as well. The error didn't happen because it never got to that point since the extension was detected as |
It's working correctly for me now: http://codepen.io/samme/pen/YVwYzm
|
Thanks for that example! It turns out the sample PVR file I was using was corrupted. I exported a new one using TexturePacker on Windows and it is now working perfectly. Thanks for the quick turnaround, really appreciated! |
Fixed in #165 |
I'm still experiencing this issue. @goldfire said he fixed the issue by using Texture Packer on Windows. Not sure if this is a Phaser bug or if Texture Packer on Mac is just exporting dodgy pvrs. The pvrs however seem fine (I can view them on the mac, they don't appear to be corrupt). |
@mattcolman I was never able to get them to work when exported on Mac, but they worked fine when exported on Windows. However, we ended up not using any compressed textures anyway because there were all sorts of issues with them on mobile and the quality was just too poor on most of our textures. |
The code should work on all systems. It's the first time that I hear that TexturePacker is producing malformed PVRs. Which settings do you use? Can you send me the .tps file and the generated files on Mac? If possible also on Windows? (put 'em in dropbox and send a link to support@codeandweb.com) |
ah ok. Good to know. Thanks @goldfire . @CodeAndWeb I'll send over the files tomorrow. |
I have the same issue, and after further investigation only DXT1 looks to works for my google chrome on macOS but it is available only on Windows. I tried every formats on osx and none looks to works. Edit : Already so basically, it is normal if PVR doesn't work on chrome desktop, and since we can't compress with DXT on osx we won't be able to make it works on a desktop. |
@goldfire @samme you look really better with webgl than me, could we have a talk about ASTC compression ? It'is like the new standard for texture compression since 1 or 2 years now and I would like to use texture compression on my webview based game like lots of phaser users I think. I already forked phaser-ce to implement this feature. The only problem still is that I absolutely don't understand how the loader parser of phaser works : If you wants to try, here an excellent texture cli compressor : (You can use this one on osx hehe) ASTC compression is available in all the latests versions of chrome/chrome mobile/firefox/ firefox mobile !! Some sources : |
@RenaudRohlinger I'd recommend using Phaser 2.6.2 or Phaser 3 and NOT Phaser-ce for webgl on mobile. In my experience phaser-ce webgl on mobile is very slow. There is actually another Open issue about it #356 |
@mattcolman I am pretty sure if we manage to use texture compression instead of png we can easily go from 15/20fps to 60fps. There is a lots of benchmark like : |
Phaser version(s): 2.7+
Line: https://github.com/photonstorm/phaser-ce/blob/master/src/loader/Loader.js#L2314
What should happen: When loading compressed textures using a format object:
The file should then be loaded like any regular PNG/JPG file.
What happens instead: The correct compressed texture is detected and used; however, it doesn't load the file. The file gets a type of
texture
. However, inside ofloadFile
, there is a check for if the key has_truecolor
in the name. If it doesn't, the file never gets loaded and the game is unable to start.I'm not sure if the issue is that the file should be marked as
image
internally instead oftexture
or if that check shouldn't be there. I haven't worked with Phaser enough to make that distinction, but hopefully someone else has some insight into why it is setup like that.The text was updated successfully, but these errors were encountered: