Jump to content

Changing image resolution for mipmapping

J. K. Sleepling

Recommended Posts

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?




Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...