melonJS
melonJS copied to clipboard
compressed textures in WebGL
one key feature still missing in melonJS, if anyone is up to it, is the ability to load compressed texture for WebGL, with the benefits of shorting loading time and using less VRAM.
At minima (if I'm correct), supporting ASTC (the new format for WebGL), DXT (for destop), PVR (for IOS) and ETC[1/2] (for Android).
Extra bonus, this tool could be integrated in the boilerplate build chain to automatically compress textures : https://www.npmjs.com/package/texture-compressor/v/0.3.1
and last but not least an interesting article here about compressed textures: https://www.shukantpal.com/blog/pixijs/do-not-use-uncompressed-textures/
You can also use TexturePacker for this - we support all these formats and in addition to that BasisU which is mentioned in the pixijs post.
BasisU uses a single texture file that is transcoded into the native formats. The only disadvantage is, that the transcoder WASM.
definitely, that's what I'm actually doing for now :)
on the article, I actually did not realise it was from pixi :P
following some recent code restructuring, the loader is now basically ready for compressed texture, see below:
https://github.com/melonjs/melonJS/blob/fd4411f17627189a691461042598441ccda593b6/src/loader/parsers/image.js#L48 https://github.com/melonjs/melonJS/tree/master/src/loader/parsers/compressed_textures
all remaining is to actually parse/transcode the texture themselves and upload them in the the GPU Ram.