{"action":"created","issue":{"url":"https://api.github.com/repos/pixijs/pixi.js/issues/4286","repository_url":"https://api.github.com/repos/pixijs/pixi.js","labels_url":"https://api.github.com/repos/pixijs/pixi.js/issues/4286/labels{/name}","comments_url":"https://api.github.com/repos/pixijs/pixi.js/issues/4286/comments","events_url":"https://api.github.com/repos/pixijs/pixi.js/issues/4286/events","html_url":"https://github.com/pixijs/pixi.js/issues/4286","id":255349862,"node_id":"MDU6SXNzdWUyNTUzNDk4NjI=","number":4286,"title":"Support for PNG_4444, PNG_565 and others","user":{"login":"Gravois","id":13366015,"node_id":"MDQ6VXNlcjEzMzY2MDE1","avatar_url":"https://avatars1.githubusercontent.com/u/13366015?v=4","gravatar_id":"","url":"https://api.github.com/users/Gravois","html_url":"https://github.com/Gravois","followers_url":"https://api.github.com/users/Gravois/followers","following_url":"https://api.github.com/users/Gravois/following{/other_user}","gists_url":"https://api.github.com/users/Gravois/gists{/gist_id}","starred_url":"https://api.github.com/users/Gravois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gravois/subscriptions","organizations_url":"https://api.github.com/users/Gravois/orgs","repos_url":"https://api.github.com/users/Gravois/repos","events_url":"https://api.github.com/users/Gravois/events{/privacy}","received_events_url":"https://api.github.com/users/Gravois/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-09-05T17:20:04Z","updated_at":"2018-06-25T14:04:05Z","closed_at":null,"author_association":"NONE","body":"To use these image formats, in order to save some gpu memory, we need to set the format and type parameters of the texture objects that are loaded to the gpu.\r\nBy default these are coded this way:\r\n \r\nglTexture = new _pixiGlCore.GLTexture(this.gl, null, null, null, null);\r\n \r\nvar Texture = function(gl, width, height, format, type)\r\n{\r\n…\r\nthis.format = format || gl.RGBA;\r\nthis.type = type || gl.UNSIGNED_BYTE; \r\n}\r\n \r\nWe need to change these two parameters on a texture basis.\r\nFor PNG_4444, this.type would need to be set to gl.UNSIGNED_SHORT_4_4_4_4.\r\nFor PNG_565, this.type would need to be set to gl.UNSIGNED_SHORT_5_6_5 and this.format to gl.RGB.\r\n \r\nWhat’s the best way to set those flags without editing PIXI’s source code?"},"comment":{"url":"https://api.github.com/repos/pixijs/pixi.js/issues/comments/399963276","html_url":"https://github.com/pixijs/pixi.js/issues/4286#issuecomment-399963276","issue_url":"https://api.github.com/repos/pixijs/pixi.js/issues/4286","id":399963276,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTk2MzI3Ng==","user":{"login":"ashleygwinnell","id":835760,"node_id":"MDQ6VXNlcjgzNTc2MA==","avatar_url":"https://avatars1.githubusercontent.com/u/835760?v=4","gravatar_id":"","url":"https://api.github.com/users/ashleygwinnell","html_url":"https://github.com/ashleygwinnell","followers_url":"https://api.github.com/users/ashleygwinnell/followers","following_url":"https://api.github.com/users/ashleygwinnell/following{/other_user}","gists_url":"https://api.github.com/users/ashleygwinnell/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleygwinnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleygwinnell/subscriptions","organizations_url":"https://api.github.com/users/ashleygwinnell/orgs","repos_url":"https://api.github.com/users/ashleygwinnell/repos","events_url":"https://api.github.com/users/ashleygwinnell/events{/privacy}","received_events_url":"https://api.github.com/users/ashleygwinnell/received_events","type":"User","site_admin":false},"created_at":"2018-06-25T14:04:05Z","updated_at":"2018-06-25T14:04:05Z","author_association":"NONE","body":"Use PVRTC for iOS and ETC1 for Android - you can test various compression formats [here](http://toji.github.io/texture-tester/).  \r\n\r\nI've implemented the ability to set these formats in [a fork](https://github.com/ashleygwinnell/pixi.js/commit/d992d35bf21615b618f95d53ea67353a839a9c62) of the dev branch. You have to pass `glFormat` and `glType` as metadata object (the third `loader.add` parameter). "}}
{"actor":{"display_login":"ashleygwinnell"}}