Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » Mipmaps

This thread is locked; no one can reply to it. rss feed Print
Mipmaps
someone972
Member #7,719
August 2006
avatar

I've got a few questions regarding mipmaps in an allegro application. Firstly is do I actually need mipmaps? I will be using stretch blit to shrink a 256x256 bitmap to as low as 32x32. If I do need mipmaps then what is the best way to produce one? Take the 9 pixels around a pixel and average them? I will be producing mip maps for 128x128, 64x64, and 32x32.

EDIT: Nevermind. I implemented it to see how much of an improvement there was, and it looks nice. The method I used for creating them was to take the average of all the pixels that would be removed in the small version and averaging them.

______________________________________
As long as it remains classified how long it took me to make I'll be deemed a computer game genius. - William Labbett
Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why. -Unknown
I have recklessly set in motion a chain of events with the potential to so-drastically change the path of my life that I can only find it to be beautifully frightening.

Tobias Dammers
Member #2,604
August 2002
avatar

You don't need mipmaps, but when you significantly scale an image (or texture) down in size, they look better than a nearest-neighbor or linear interpolation approach. You calculate each mipmap level by averaging four pixels (not 9) from the next larger level. IIRC, OpenGL can automatically generate mipmaps for you if asked nicely.

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Go to: