What's the advantages and disadvantages of PowerVR?
My game engine recently added PowerVR (PVR) support, after s开发者_如何学运维ome search on Google and Wikipedia, I only know the definition of PVR, but I don't know what is it use for, what are its advantages and disadvantages. I'm developing game for Android, what should I use, PNG or PVR?
(PowerVR is a brand name of Imagination Technologies Ltd. referring to their graphics acceleration technology. PVR is a texture container format used in the PowerVR Insider SDK. PVRTC is PowerVR's texture compression scheme which is what I think you're interested in... apologies if you're not)
PVRTC is a runtime texture compression format for use with PowerVR graphics accelerators (a lot of the Android platforms have one of these). Compared to uncompressed 32bit textures, PVRTC offers a 8x or 16x compression in 4 bit per pixel or 2 bits per pixel mode. Because it's a runtime texture compression scheme it doesn't need to be decompressed at any stage outside the graphics core itself (and there's dedicated circuitry for that bit on there) so that data is smaller on disk, smaller to upload to GL, smaller in memory and smaller in use when rendering - better and faster in almost every way. On mobile systems, where memory bandwidth is precious and is often the performance bottleneck for graphics, it can make a huge difference to your framerate (and also power use - memory accesses take power).
Downsides:
- PVRTC tends to be larger than PNG on disk - PVRTC data zips (for instance) quite well for disk storage.
- PVRTC is lossy compression - sometimes artifacts can be seen in PVRTC textures when compared to source images. PNG is lossless so that problem isn't there
- PVRTC is not available for use with other graphics acceleration than PowerVR (at the moment) - look at DXT/S3TC (larger) or ETC (no alpha) compression for other platforms.
- Only square, power-of-two dimension textures are likely to work - e.g. 32x32, 512x512 etc.
- Compression can be pretty slow
PNG isn't a runtime format so the only place that there is an advantage in PNG compression over uncompressed images is storage on disk (or sending over a network etc.) - PNG image data has to be decompressed by the CPU before it can be passed to GL or drawn in any way i.e. PNG is as slow as you can get for textures on these platforms.
PNG is lossless and also supports an alpha channel.
So...
For best performance, use PVRTC where you can and have other versions of your textures available if you can't - e.g. where compression artefacts are too obvious or the platform that you're running on doesn't support it.
Further reading:
- http://imgtec.com/powervr/insider/powervr-faq.asp
- http://imgtec.com/powervr/insider/docs/PVRTextureCompression.pdf
- http://imgtec.com/forum/default.asp
To make PVRTC textures:
- http://imgtec.com/powervr/insider/powervr-pvrtextool.asp
Hope that helps...
精彩评论