Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do PVR textures consume less RAM?

It is my understanding that PVR textures, made with texturetool, are simply compressed images. Therefore the difference lies in the file size.

Frankly, the file size doesn't interest me. What I want to know is, can a PVR texture consume less RAM than a normal .PNG texture? Or does this depend entirely on the texture format (like RGBA8888 etc)?

The essential question would be:

Given X.png and X.pvr, if I display both with texture format RGBA8888, will one consume less RAM than the other?

like image 728
Voldemort Avatar asked Nov 20 '25 03:11

Voldemort


2 Answers

Yes, the PVR will consume less RAM at all stages — it's unpacked live by the GPU as it's accessed. There's no intermediate decompression.

A PVR-like approach used in digital video is that instead of storing RGB at every pixel, convert to YUV, then store Y at every pixel and U and V only twice per four-pixel block. So you go from 128 bits for the block to 64 bits. To get back to RGB the outputter reads the exactly correct Y and interpolates or accesses the most nearby U and V as necessary.

Schemes like PVR do a similar thing of not storing the full value at every pixel but inferring parts of it from nearby context. What counts as nearby is picked directly corresponding to however the caching is arranged on that GPU. It's usually more in-depth that just scaling down the sampling resolution of some of the channels, e.g. specifying a base offset for samples and then using a tiny precision for each is also common.

So the GPU can always get a value for pixel X by reading only values in a very small, local region of the data.

This contrasts with traditional schemes like PNG where having to know every pixel in the stream prior to X is acceptable if it improves the compression. Processing such things live would flood the GPU's memory bandwidth and hence be completely impractical, so such textures are decompressed from disk and then uploaded.

So schemes like PVR tend to lead to poorer compression and lower per-pixel quality but the win is that they can sit in VRAM compressed. A game will often increase the resolution of its textures if using PVR to try to find a comfortable balance.

like image 109
Tommy Avatar answered Nov 22 '25 18:11

Tommy


Uncompressed textures are:

16 bit per pixel (RGB565, RGBA4444), 24 bit per pixel (RGB888)

PVRTC textures are either 4bpp or even 2bpp. So yes they do use less memory.

Also they perform better because need less memory bandwidth to fetch textures.

like image 34
keaukraine Avatar answered Nov 22 '25 16:11

keaukraine



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!