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.
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…
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.
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.
I’m glad you asked, as there are two main advantages:
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:
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.
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 forum.