LayerData

From Second Life Wiki
Revision as of 23:57, 6 October 2019 by Chaser Zaks (talk | contribs) (Resolved unknown values)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Message Layout

{
	LayerData High Trusted Unencoded
	{
		LayerID				Single
		{	Type			U8	}

	}
	{
		LayerData			Single
		{	Data			Variable	2	}
	}
}

Usage and Notes

LayerData packets transmit terrain, wind, and cloud information using a custom IDCT routine similar to JPEG but with different coefficients. The data in these packets is stored in a proprietary format of 16x16 meter blocks.

Type:

     -  76 : LLSurface (terrain)
     -  55 : LLWind (wind)
     -  56 : LLCloudLayer (Cloud)

Data:

[patchgroupSize] - uint8
[quant_wbits] - uint8
[patchHeader]
[patchSize] - uint8
[dc_offset] - uint32
[range] - uin16
[patchIDs] - 10 bit unsigned integer
[patchData]
[zeroCode] - One bit. If 0, the data is zerocoded
[hasData] - One bit, If 0, the entire patch is zeros.
[data] - has a size of (patchSize % 16) + 2
[data] ... - repeat until patchSize has been read
[patchHeader] ... - repeat until patchgroupSize has been read
...

The data then has to be decompressed, and I have no idea how this data is used.

You may find some use from the psuedocode at LibSecondLife.org