Why you really should be using mipmapping in your graphics applications

Share on linkedin
Share on twitter
Share on facebook
Share on reddit
Share on digg
Share on email

The new PowerVR developer documentation website has been up and running for a few weeks now. We’re really pleased to see how it’s been helping people get the most out of their applications, as well as learn new things about graphics programming and PowerVR.

If you still haven’t taken the time to check it out (you really should!) and you need to be convinced, here’s a quick preview of a topic you will find in our PowerVR Performance Recommendations.

Along with our documentation for advanced graphics developers, we’ve recently been taking more time to help those new to graphics programming, as evidenced by our new “Getting Started” guides to both Vulkan® and OpenGL® ES. So the topic today is all about mipmapping – you’ll get a very quick introduction, and also some top tips including some specific to PowerVR.

Introduction to mipmapping

In a nutshell, for almost all graphics applications, mipmapping is incredibly useful as it increases cache efficiency and reduces bandwidth usage, all for only a modest increase in texture file size.

However, for the uninitiated…

What is mipmapping?

Mipmaps are smaller, pre-filtered versions of a texture image, representing different levels of detail (LOD) of the texture. They are often stored in sequences of progressively smaller textures called mipmap chains with each level half as small as the previous one.

They are used for situations where the distance between an object and the camera can change. As the object gets further from the camera, the object’s texture will eventually appear smaller on-screen than its actual resolution, in other words, there will be more than one texel (pixels of a texture map) per screen pixel. The texture will have to be scaled down in a process called minification filtering, which often requires the application to sample multiple texels to decide on the colour of a pixel. This becomes a problem when you need to sample the entire texture at runtime for an object that could only be a single pixel wide.

This is where mipmaps come in. Instead of sampling a single texture, the application can be set up to switch between any of the lower resolution mipmaps in the chain depending on the distance from the camera.

Can you explain the benefits in a bit more detail?

I’m glad you asked, as there are two main advantages:

  1. Improved image quality – Using mipmapping can help to eliminate aliasing effects caused by oversampling textures. These effects can potentially ruin the visual quality of the application.
  2. Increased performance Mipmapping increases cache efficiency as full-size textures will not be needed as often, and the lower resolution mipmaps will fit more easily in the texture cache. This means texture data doesn’t have to be fetched as often, reducing bandwidth usage and increasing application performance.

What’s the catch? Well, the only notable drawback for most applications is the increase in texture file size, as the full mipmap chain has to be stored alongside the full resolution texture. This increases file sizes by about 33%, but with the increase in rendering speeds and image quality, this really doesn’t matter much.

There are also some situations where mipmapping isn’t very useful, for example:

  • Objects which will never change their distance from the camera, for example many UI elements. The LOD of these elements is never going to change, so in this case, mipmapping is pointless.
  • Circumstances where filtering cannot be applied sensibly, such as for index and depth textures which contain non-image data.

Generating mipmaps

Mipmaps can either be created offline or during runtime. The decision comes down to a balance between the storage cost of offline generation and the increased workload of runtime generation. In most cases, however, offline is best.

Our very popular texture-processing utility PVRTexTool (included with the PowerVR SDK) can be used to generate a mipmap chain for a texture, with only a couple of clicks. The mipmapped image can then be saved using our proprietary compressed PVRTC texture format, or a wide range of other formats.

If you really want to generate mipmaps at runtime (and lose the benefit of PVRTC or other compressed formats), OpenGL ES provides the function glGenerateMipmap. Unfortunately, Vulkan doesn’t have any built-in function for this, so you’ll need to implement it yourself.

Want to hear more about mipmapping?

For more about mipmapping, you might like to take a look at some of our following articles:

And finally…

For more PowerVR performance recommendations and other useful developer information, please visit our new, regularly-updated website at docs.imgtec.com.

Do feel free to leave feedback through our usual forums or ticketing systems.

You can also follow @tom_devtech on Twitter for Developer Technology-related news, or @powervrinsider for the latest on PowerVR!

Benjamin Anuworakarn

Benjamin Anuworakarn

Ben Anuworakarn is a technical author in the PowerVR Developer Technology team and has a computer science engineering background. Primarily responsible for producing and maintaining both internal and external documentation, he has a knack for coming up with solutions to problems that don't exist yet. You can find him either clacking away at his keyboard or shuffling trading cards every few hours.

Please leave a comment below

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted. We respect your privacy and will not publish your personal details.

Blog Contact

If you have any enquiries regarding any of our blog posts, please contact:

United Kingdom

[email protected]
Tel: +44 (0)1923 260 511

Search by Tag

Search by Author

Related blog articles

Beaglebone Black

Fun with PowerVR and the BeagleBone Black: Low-Cost Development Made Easy

Development boards are cool and the BeagleBone® Black (BBB) is one of the more interesting ones around. This widely available tiny board costs around £35 and will boot Linux is only 10 seconds so anyone interested in development can get stuck in quickly. The Introduction to Mobile Graphics course has been recently revamped for 2020 for the Imagination’s University Programme and the widely available, low-cost BBB is an ideal platform for student teaching and exercises based on OpenGL® ES2.0, instead of an expensive standard PC.

Read More »
pvrtextoolgui sunrise 2

PowerVR SDK and Tools 2020 Release 2 now available

We all know that 2020 has been quite a challenging year, but we hope you’re doing well. Over the last few months, here in DevTec, we’ve been working hard to get this new release out for you and the time has now come for our second release of the PowerVR SDK and Tools of 2020. So, what’s new with this latest release? Let’s take a quick look at a few of the major changes.

Read More »
pvrtune complete

What is PVRTune Complete?

PVR Tune Complete highlights exactly what the application is doing at the GPU level, helping to identify any bottlenecks in the compute stage, the renderer, and the tiler.

Read More »


Sign up to receive the latest news and product updates from Imagination straight to your inbox.