Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Unable to load etc1 (pvr) texture #15

Open
mityok opened this issue Oct 16, 2017 · 7 comments
Open

Unable to load etc1 (pvr) texture #15

mityok opened this issue Oct 16, 2017 · 7 comments

Comments

@mityok
Copy link

mityok commented Oct 16, 2017

I'm trying to use compressed textures in mobile application. and i'm unable to load etc1 texture, i'm getting those warnings and a black square:
WebGL: INVALID_ENUM: compressedTexImage2D: invalid format
CompressedImage.generateWebGLTexture @ pixi-compressed-textures.js:22303
[.Offscreen-For-WebGL-0xdd8fe800]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.

this is the code i'm using:

var extensions = PIXI.compressedTextures.detectExtensions(app.renderer);
var loader = new PIXI.loaders.Loader();
loader.pre(PIXI.compressedTextures.imageParser());
loader.add('shannon', 'data/shannon-etc1.pvr');
loader.load(function(loader, resources) {
    var sprite = new PIXI.Sprite(resources['shannon'].texture);
    app.stage.addChild(sprite);
});

and the pvr file is taken from this site, witch shows pvr (etc1) just fine on my tablet

@ivanpopelyshev
Copy link
Contributor

OK, I'll try to look at it on my android phone. Actually, I didnt check if ETC1 is working in this plugin at all.

@ivanpopelyshev
Copy link
Contributor

@mityok
Copy link
Author

mityok commented Oct 16, 2017

yes, it enters into that case

@andrewstart
Copy link
Contributor

On your GL context (app.renderer.gl, I think), try calling gl.getExtension('WEBGL_compressed_texture_etc1'). It looks like we aren't checking for the ETC extension, so I assume that manually enabling the extension will work.

@mityok
Copy link
Author

mityok commented Oct 17, 2017

yes, that worked, adding etc: getExtension(gl, "WEBGL_compressed_texture_etc1") fixed it

@zprodev zprodev mentioned this issue Feb 5, 2018
@EloB
Copy link

EloB commented Oct 15, 2018

I'm also trying to use etc1 but getting "Uncaught Compressed texture format is not recognized". Never used etc1 before. So maybe I'm doing some wrong thing. Which tool do you use to create etc1 files and if command line how do you write?

This file was working but I have no idea how they built it. http://toji.github.io/texture-tester/textures/shannon-etc1.pvr I will be super happy if you can pin point me in the right direction :)

@eXponenta
Copy link
Contributor

pvrtc with etc1 encoding isn't raw etc1.
pvrtc - is container for different encodings formats.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants