J. K. Sleepling Posted November 2, 2018 Share Posted November 2, 2018 Hi there, I'm working on an app showing user uploaded maps (bitmaps). These maps can be of any resolution and often they are very large. Now down-scaling these images they become ugly and crunched, so I need to use mipmapping (Working in WebGL). I know mipmapping only works with "powered by two" resolutions, but is there any way I can resample my odd-sized maps, to fit into a "pb2" resolutioned baseTexture, and still know the original specs. Or how would you work around it? Thanks Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 2, 2018 Share Posted November 2, 2018 First idea - put it on pow2 canvas and use "Texture.fromCanvas", then create texture regions (new PIXI.Texture(myBaseTexture, myFrame)) out of it. Second - do it automatically, when you upload the texture. That's not easy way, it requires understanding of TextureManager hacks. The part that corresponds to your mipmapping issue is the same: texture uploader. Its possible. Its not available at high-level API yet. It exists in a plugin that makes atlases out of things. However, maybe you just have to use this plugin: https://github.com/gameofbombs/pixi-super-atlas/ . I'm sorry, there are no examples except https://github.com/gameofbombs/pixi-super-atlas/blob/master/test/checkpack.ts . It also has "addTexture" method , but you have to look at sources anyway, dont assume that its magic that works for everyone, its a bleeding edge plugin. Quote Link to comment Share on other sites More sharing options...
J. K. Sleepling Posted November 2, 2018 Author Share Posted November 2, 2018 Thanks Ivan. Think I'll go for the first idea. I need to remember the original image specs, so I can make a texture in the right format later. 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.