colourclash Posted February 5, 2016 Share Posted February 5, 2016 Anyone using Crunch to squash compressed texture file size (https://github.com/richgel999/crunch) in conjunction with Pixi? Would it be a matter of writing a middleware plugin for the resource loader? Upon decompression what would be the best way to make a Pixi texture? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 5, 2016 Share Posted February 5, 2016 DXT compression works only on windows, is that right? As for CRN - yeah, you'll need a parser. You can make a PR to this project: https://github.com/pixijs/pixi-compressed-textures . Without this plugin PIXI cant show DDS textures. Quote Link to comment Share on other sites More sharing options...
colourclash Posted February 5, 2016 Author Share Posted February 5, 2016 Yes, hopefully Crunch gets PVRTC support sometime soon. If I get something working I'll make a PR Thanks! Quote Link to comment Share on other sites More sharing options...
GBear Posted February 6, 2016 Share Posted February 6, 2016 @ivan.popelyshev pix.texture manually control basetextures when update or delete with dds? and this is different issue normally dxt compression file is big than png or jpg so it need to compress by zip or something if not, loading time is more delayed.. this is so critical light game is maybe no problems and it will not be needing texture compression ... but if game is heavy .. hmm if use compressed texture like dxt , it have to consider one more compression like 'zip' to reduce loading time.. ToT.... ..Complexing Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 6, 2016 Share Posted February 6, 2016 1. pixi.compressedTextures uploads dds textures manually, because it cant hack into WebGLRenderer internals. There is "uploadAllTextures" method. 2. You can configure gzip on your web-server, so it will cache gzipped dds files , both nginx and lighttpd can do that Quote Link to comment Share on other sites More sharing options...
GBear Posted February 6, 2016 Share Posted February 6, 2016 Quote 2. You can configure gzip on your web-server, so it will cache gzipped dds files , both nginx and lighttpd can do that oh. really? does it automatically create gzipped dds on web-server and gzipped dds transferred between client and server? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 6, 2016 Share Posted February 6, 2016 Yep. Which server do you use in production? Quote Link to comment Share on other sites More sharing options...
GBear Posted February 7, 2016 Share Posted February 7, 2016 i'm using nginx... Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 8, 2016 Share Posted February 8, 2016 13 hours ago, GBear said: i'm using nginx... http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html#example Quote Link to comment Share on other sites More sharing options...
GBear Posted February 10, 2016 Share Posted February 10, 2016 @ivan.popelyshev thx... ^^/ i will test..soon with dds and pixi.compressed.texture have other compressed texture type to use on IOS? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 10, 2016 Share Posted February 10, 2016 Yeah, you need PVR for iOS: https://community.imgtec.com/developers/powervr/tools/pvrtextool/ If you want to use pre-gzipped file with nginx: http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html , but you can also enable dynamic gzipping : http://nginx.org/ru/docs/http/ngx_http_gzip_module.html dont forget to add "image/dds" to mime-types.conf Quote Link to comment Share on other sites More sharing options...
GBear Posted February 11, 2016 Share Posted February 11, 2016 16 hours ago, ivan.popelyshev said: dont forget to add "image/dds" to mime-types.conf @ivan.popelyshev is this only for ' dynamic gzipping '? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 11, 2016 Share Posted February 11, 2016 @GBear correct mime type wont hurt in any case Quote Link to comment Share on other sites More sharing options...
GBear Posted February 11, 2016 Share Posted February 11, 2016 is there using only dxt1 format with webgl? or etc1.. on android? ios look like to be using PVRTC.. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 11, 2016 Share Posted February 11, 2016 dxt1 will work. But for etc1 you need alpha-sprite, and we are still experimenting with it : https://dl.dropboxusercontent.com/u/36289/xfer/2016/pixijs_apply-alpha_quick_test.zip Quote Link to comment Share on other sites More sharing options...
chg Posted February 12, 2016 Share Posted February 12, 2016 12 hours ago, GBear said: is there using only dxt1 format with webgl? or etc1.. on android? ios look like to be using PVRTC.. Let http://webglstats.com/ be you guide perhaps? On 10/02/2016 at 8:49 PM, ivan.popelyshev said: dont forget to add "image/dds" to mime-types.conf also as per https://msdn.microsoft.com/en-us/library/windows/desktop/dn424129(v=vs.85).aspx I believe the "correct" mimetype name to be "image/vnd-ms.dds" for dds texture files Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 12, 2016 Share Posted February 12, 2016 Quote also as per https://msdn.microsoft.com/en-us/library/windows/desktop/dn424129(v=vs.85).aspx I believe the "correct" mimetype name to be "image/vnd-ms.dds" for dds texture files Wow, didnt know that Quote Link to comment Share on other sites More sharing options...
GBear Posted March 4, 2016 Share Posted March 4, 2016 hi. if i use etc1 i will be need mask image.. and this case drawcall is up... because pixi.js is called flush() if sprite has mask hmm.. png and etc1 which format is good to reduce memory? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 4, 2016 Share Posted March 4, 2016 @GBear we are working on it Its not for production yet: https://github.com/MattOstgard/pixi-alpha-map Quote Link to comment Share on other sites More sharing options...
GBear Posted March 4, 2016 Share Posted March 4, 2016 @ivan.popelyshev hi ivan ^^/ let's work together .. ^^... and this is different issue can i get texture by r, g, b channel on same basetexture of png? becuase i will use bitmapfont and i wanna add many language like korean, japanese, chinese.,english.. russian... english, russian...is no problems because that has litte words.. but korean, japaness, chines is not... so i will add all words on separated channel Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 4, 2016 Share Posted March 4, 2016 That's good idea. Also may be we can try implement distance field font in pixi Quote Link to comment Share on other sites More sharing options...
GBear Posted March 10, 2016 Share Posted March 10, 2016 @ivan.popelyshev hi ivan.. ^^/ i'm preparing to test texture compress my packed image is loaded from atlas(texture packed by spine) and inner file is png how can i load dds from atlas would you give me tips? Quote Link to comment Share on other sites More sharing options...
GBear Posted March 10, 2016 Share Posted March 10, 2016 @ivan ignore upper issue..^^/ can't i load compressed Texture by basetexture.fromImage()? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 10, 2016 Share Posted March 10, 2016 If its a first time - no you cant. It works only through loader and then it must be uploaded with updateTexture or updateAllTextures that is in pixi-compressed-textures plugin. If you already used it in loader, then fromImage will work just fine. Quote Link to comment Share on other sites More sharing options...
GBear Posted March 10, 2016 Share Posted March 10, 2016 @ivan.popelyshev hi ivan.. i'm using loader.. but a little different using. my atlas is zipped because reducing capacity. so zipped atlas loaded first and read atlas manually, and load basetexture Quote Effect_AnimLoader.prototype.createAtlas = function(atlas_src) { var spine = PIXI.spine.SpineRuntime; var base_path = this.data_path ; if(__isMobile){ var atlas = new PIXI.spine.SpineRuntime.Atlas(atlas_src, 'data/packed', null, 0.5); }else { //var atlas = new spine.Atlas(atlas_src, base_path, null, null, 'effect.dds'); var atlas = new spine.Atlas(atlas_src, base_path, null, null); } // create base textures for (var i in atlas.pages) { var page = atlas.pages; atlas.updateUVs(page); var baseTexture = page.rendererObject; //baseTexture.mipmap = false; if (baseTexture.hasLoaded) { __main.renderer.updateTexture(baseTexture); } else { baseTexture.once('error', function () { console.log('error'); }, baseTexture); baseTexture.once('update', function () { __main.renderer.updateTexture(this); }, baseTexture); } } var regions = atlas.regions; for (var i in regions) { var region = regions; var texture = createTextureByRegion(region); //var texture_name = 'data/image/' + region.name + '.png'; var texture_name = region.name; PIXI.Texture.addTextureToCache(texture, texture_name); } return atlas; }; hmm.. --? where can i change? and second question how do you think about under issue 1. which format is good between png(8bit by tinyPNG) and etc1+mask - png is very very small but i don't know how bad than compressed textures on gpu about performance or memory compressed textures is bigger than png so download time is long.. this is big issue.. so i'm wondering about which format is good... I need two thing T-T (performance and download time) do you know how much frame is up by texturecompressing by tested spine? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.