[sldev] Reformatting Textures for the cache

Tofu Linden tofu.linden at lindenlab.com
Thu Mar 22 10:26:55 PDT 2007


Jason Giglio wrote:
> I don't know if we can store much raw RGBA raster in any meaningful way.
>  One 512x512 texture is 1MB.
> 
> The "uncomressed cache" could be using some simple and fast compression
> algorithm like RLE, which would still give a huge benefit in size.

I'm not quite sold on the benefits of caching to a fat lossless
format - this could easily move us from our current system which is
quite CPU-bound but very parallelizable, to another extreme which is
heavily IO-bound and artificially serialized by disk access.

There is probably a happier medium, but a first point of call would
be to investigate improvements to the empirically-non-stellar hit-rate
of the first-level caching before masking or propagating its weaknesses
through a few more level of experimental caching. :)

Back to the post at hand, RLE is cheap but also not very effective
at all for many, many textures; wherever I might have used RLE in
ye olden days I'd now use trusty old zlib or blingy liblzf, the
latter of which is more or less on the same order of speed
as RLE but a LOT more effective on data (images) with redundancy
not necessarily manifesting as runs of pixels.

But once images have gone to a lossy JPEG2000 encoding and back,
frankly, they're rarely byte-intact enough for lossless compression
to do a *great* job, however clean the originals might have been.

- Tofu


More information about the SLDev mailing list