pixi-compressed-textures icon indicating copy to clipboard operation
pixi-compressed-textures copied to clipboard

Not working with PIXI v5.1.1

Open Senglean opened this issue 5 years ago • 15 comments

Problem starts @ line

CompressedTextureManager.prototype = Object.create(WebGLManager.prototype);

Error : WebGLManager undefined

Senglean avatar Aug 20 '19 16:08 Senglean

We dont have v5 compatibility. There was a PR for v5 to add in pixijs itself, but it failed.

I think I'll port this thing next week, is that ok for you?

Later, we'll make BASIS support in v5 itself.

ivanpopelyshev avatar Aug 20 '19 16:08 ivanpopelyshev

If you cant wait, then you can try to port it yourself through TextureResource API: https://pixijs.io/examples/#/textures/gradient-resource.js

ivanpopelyshev avatar Aug 20 '19 16:08 ivanpopelyshev

Of course we can wait next week, thanks for your support and dedication.

Senglean avatar Aug 20 '19 16:08 Senglean

hi ivanpopelyshev, any progress :) ?

roblyr avatar Aug 30 '19 07:08 roblyr

Yo! almost there. Gonna publish it today :)

ivanpopelyshev avatar Aug 30 '19 12:08 ivanpopelyshev

OK, done, please test it!

Its in dist folder, or npm 2.0.0

https://pixijs.io/examples/#/plugin-compressed-textures/dds.js

In case you need just basic stuff (load dds), there's a not in README, nothing special has to be done :)

ivanpopelyshev avatar Aug 30 '19 15:08 ivanpopelyshev

Thank you very much!

roblyr avatar Sep 01 '19 18:09 roblyr

Hi , thanks for the update..I'm trying to implement in our game but it never tries to load @2x..only @1x works.

Our export consists of the following structure :

spine.json [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]

tried various options for the asset loader in particular

{metadata: {spineMetadata: {choice: ["@2x.png", "@1x.png", "@.5x.png", "@.5x.atlas", "@1x.atlas", "@2x.atlas", ".atlas", ".png"]}}}

The spine object doesn't load if I only specify @2x in the options, it asks for the atlas file (without any @ extension)

This is the code before the assets add method :

var ext = PIXI.compressedTextures.detectExtensions(renderer); this.loader.pre(PIXI.compressedTextures.extensionChooser(ext));

am I missing something ?

Thank you in advance.

Senglean avatar Sep 17 '19 16:09 Senglean

Check whats in ext.

ivanpopelyshev avatar Sep 17 '19 18:09 ivanpopelyshev

@Senglean ok, i think we broke it,I'm making spine example

ivanpopelyshev avatar Sep 19 '19 13:09 ivanpopelyshev

@Senglean I think it asks for atlas file without resolution when said resolution is not 0.5 , 1, 2. Like, you opened it on x1.25 or x3 devicePixelRatio. @1x is not our default fallback, I think we need a setting for default fallback setting.

ivanpopelyshev avatar Sep 19 '19 13:09 ivanpopelyshev

@Senglean

workaround for now: place copy of @1x without that suffix.

ivanpopelyshev avatar Sep 19 '19 14:09 ivanpopelyshev

@Senglean

OK, can you please test latest version from this repo from dist folder? Specify [email protected] instead of spine.json there.

ivanpopelyshev avatar Sep 19 '19 14:09 ivanpopelyshev

hello sorry for not following, will test once in office.

right now I'm forcing the resolution with

this.loader.pre(PIXI.compressedTextures.extensionChooser(["@2x.atlas"]));

which is fine for us, but others may encounter problems.

Senglean avatar Sep 19 '19 18:09 Senglean

@Senglean I've found the problem and fixed it. The thing is, we have to add @1x in detect list (detectExtensions) even if renderer resolution is not 1, because if its not 1 nor 2 you wont have files, for it, right? Need @1x as a fallback.

Yes, its not obvious, but i dont have any better options :(

Please test it. npm 2.0.4

ivanpopelyshev avatar Sep 22 '19 12:09 ivanpopelyshev