Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How does mipmap generation work

Author
Message
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 23rd Aug 2013 16:54
I'm thinking of using mipmap generation quite a bit for my upcoming game and a little concerned about memory usage, but not very much since my game has very few assets to begin with.
Right now I'm only using SetGenerateMipmaps on a few images (font and some images that get scaled way down). I'm curious as to how it works.
Does it generate a bunch of images automatically, or does it generate only those image sizes which are needed when the sprite the image is attached to is sized?
Thanks!

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 25th Aug 2013 12:42
There are a few ways that the mipmap texture can be laid out, different scaling options, fading colour, fading alpha... but usually the original image is made bigger, and scaled copies of the texture are stored in the extended size. Then when it has to render the image, it has a half size, quarter size, eighth size etc etc, so it can use the appropriate part of the image for the displayed scale.

This is really a guess though, based on the way DDS textures are created.

I am the one who knocks...
haliop
User Banned
Posted: 25th Aug 2013 13:03
i dont understand why using them at all..
if your texture is well designed and well detailed.. then there is no need.. am i wrong?

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 25th Aug 2013 17:28
@van b - thanks. I'm going to just assume ago is also that way. It doesn't matter much for me since I only actually have a few images.

@haliop - any image when scaled has a high potential for loss of quality due to averaging. This is most noticeable in fonts for me. Since we're working with mobile devices with a large variety of sizes I think mipmapping is especially important. Another example I have is a small radial button texture I have that is 32x32. If I want to scale it very small, say 8x8, then it is a bad scenen, but after mipmapping it is crisp and clear.

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 4th Sep 2013 19:37
Quote: "Does it generate a bunch of images automatically, or does it generate only those image sizes which are needed when the sprite the image is attached to is sized?"


It generates the scaled down images when the original image is loaded, and uses about 33% more memory than the original image by itself.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 4th Sep 2013 19:38
Very good to know the specific memory usage. Thanks, Paul!

Login to post a reply

Server time is: 2024-05-09 10:48:55
Your offset time is: 2024-05-09 10:48:55