Difference between revisions of "LayerData"

From Second Life Wiki
Jump to navigation Jump to search
(Resolved unknown values)
 
(One intermediate revision by one other user not shown)
Line 18: Line 18:
==Usage and Notes==
==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 that has been partially reverse engineered.
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:
Type:
Line 29: Line 29:


:[patchgroupSize] - uint8
:[patchgroupSize] - uint8
:[unk] - uint8
:[quant_wbits] - uint8
:[patchHeader]
:[patchHeader]
::[patchSize] - uint8
::[patchSize] - uint8
::[unknown0] - uint32
::[dc_offset] - uint32
::[unknown1] - uin16
::[range] - uin16
::[unknown2] - 10 bit unsigned integer
::[patchIDs] - 10 bit unsigned integer
:[patchData]
:[patchData]
::[zeroCode] - One bit. If 0, the data is zerocoded
::[zeroCode] - One bit. If 0, the data is zerocoded

Latest revision as of 22:57, 6 October 2019

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