[sldev] Reformatting Textures for the cache
Thomas Rowland
tom at cornish-pasty.com
Thu Mar 22 08:20:19 PDT 2007
That is almost exactly what I suggested, only my email appears to have been
lost in the list.
The only thing I had not thought of was the different files for different
sizes bit. I kind of like the idea of using fixed cell sizes.
I suggest a thread manage the index and cache, which could if enough ram is
there be in ram (why cache anyway if there is the ram?).
The 'raw' data would be of eg. ARGB raster (1 U32==1pixel), as you also
mention.
> -----Original Message-----
> From: sldev-bounces at lists.secondlife.com
> [mailto:sldev-bounces at lists.secondlife.com] On Behalf Of
> Tinker LaFollette
> Sent: 22 March 2007 14:45
> To: sldev at lists.secondlife.com
> Subject: Re: [sldev] Reformatting Textures for the cache
>
>
> On 3/22/07, Tim Shephard <tshephard at gmail.com> wrote:
> > > /cache/6c/48/94/6c489466-3058-6475-6b1b-e5fc1d49f1f3.tga
> > >
> >
> > You want to open a file for every texture you need to decode?
> > Yiiikes.
>
> How about this: have one big cache file for each image *size*
> cached. Each cache file is divided into fixed cells
> containing the uncompressed images. So your lookup would be
> UUID => (width,height,depth,cell#), e.g.:
>
> 6c489466-3058-6475-6b1b-e5fc1d49f1f3 => 256,512,32,37
>
> and you would go to the file /cache/images/256-512-32 (which
> may already be open) and retrieve the image from the 37th
> cell of that file.
>
> Because all image dimensions are powers of two, you won't
> have a combinatorial explosion of image sizes. (You could
> reduce the number of cache files by storing 256x512 and
> 512x256, etc., in the same
> file.) Because the files are divided into fixed cells, you
> can delete and insert images within the cache file without
> fragmentation.
>
> (Not knowing much about image file formats, I'm making the
> naive and probably wrong assumption that uncompressed images
> of the same dimensions occupy the same number of bytes. Even
> if it's not strictly true, it might be close enough to true
> if we can live with a little
> padding.)
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html
>
More information about the SLDev
mailing list