[sldev] Meaning of RequestImage DiscardLevel field?

Robin Cornelius robin.cornelius at gmail.com
Thu Sep 18 15:30:08 PDT 2008


John Hurliman wrote:
> I know that the DiscardLevel field in the RequestImage packet is used to
> request different quality levels (not different texture sizes as the
> protocol documentation states, SL uses LRCP ordered JPEG2000 files), but
> i can't figure out what the values correspond to. In a typical texture
> download I'll see values ranging from -1 to 5. Is -1 a special value? Is
> there an upper limit? Does a larger number mean a lower quality layer?
> 

Hey John,

The discard field is directly related to the request quality level as
you are already aware. It should be a simple calculation that the
discard is the number of powers of 2 to scale the image down by for the
reduced quality. So a discard of 0 is the complete image and a discard
of 1 is a 1/2 size, a discard of 2 is a 1/4 size etc.

The wiki confusion probably comes from the fact the texture console
displays the scaled down size, so a discard of 4 on a 512x512 texture is
displaying as a 64x64 on the texture console until it gets enough data
to cross to a better discard level then the texture console will update
to show the last successful decoded threshold.

The -1 is used to cancel a request image and also seems to be the
default initialiser for most of the internal discard fields.

The range of the data is kind of predetermined for SL by the values set
in the encoder used for image upload. I guess you could upload textures
with different discards but i believe we have been around this loop
before with early implementations of openjpeg which did it differently
to KDU and caused various image breakage. Also we know until recently
the viewer was making hideous assumptions about the data length of a
given discard level and guessing how much data would be present (top
corner jobs), i believe the server is still doing this and thats why
some textures take a long time to download although things do seem much
much better so maybe this has been addressed as well.

Well thats what i know from having my head stuck in the texture pipeline
;-) Hope its helpful

Robin/MichelleZ









-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.secondlife.com/pipermail/sldev/attachments/20080918/3becd16e/signature.pgp


More information about the SLDev mailing list