Difference between revisions of "Sims 3:0x01D0E723"

From SimsWiki
Jump to: navigation, search
Line 13: Line 13:
 
  BYTE Usage // 0=position, 1=normal, 2=UV, 3=assignment, 4=skin weight, 5=tangent
 
  BYTE Usage // 0=position, 1=normal, 2=UV, 3=assignment, 4=skin weight, 5=tangent
 
  BYTE UsageIndex
 
  BYTE UsageIndex
  BYTE Type // Data type, one of [http://msdn.microsoft.com/en-us/library/bb172533(VS.85).aspx D3DDECLTYPE]
+
  BYTE Type // compression format (see below)
 
  BYTE Offset // Offset into the vertex declaration for the data
 
  BYTE Offset // Offset into the vertex declaration for the data
  
 +
Compression formats:
 +
07 = 3 floats in 4 words. The fourth word is an unsigned scaler, multiply each signed word by 1/scaler (or use 512 if zero)
 +
06 = 2 floats in two words. Multiply the signed values by 1/32767
 +
05 = 3 floats in 4 bytes. Order is little-endian, use the low order byte (4th) as an unsigned scaler value. For each remaining signed byte, if negative, add it, if positive, subtract it, then multiple the result by 1/scaler, or by 1/127 if scaler is 0
 +
04 = 4 small ints.
 
<hr/>
 
<hr/>
 
[[Sims 3:Main Page]] -> [[Sims 3:PackedFileTypes]]
 
[[Sims 3:Main Page]] -> [[Sims 3:PackedFileTypes]]
 
<br/>[[Sims 3:Main Page]] -> [[Sims 3:RCOL]]
 
<br/>[[Sims 3:Main Page]] -> [[Sims 3:RCOL]]

Revision as of 15:10, 28 July 2009

Sims 3:Main Page -> Sims 3:PackedFileTypes
Sims 3:Main Page -> Sims 3:RCOL


Vertex Format

This is a Sims 3:RCOL chunk found embedded in MODL and MLOD resources.

DWORD // 'VRTF'
DWORD // 00000002
DWORD // Vertex data length (Bytes)
DWORD // Declaration count
DWORD // Unknown (0)

For each count vertex declaration, a packed form of D3DVERTEXELEMENT
BYTE Usage // 0=position, 1=normal, 2=UV, 3=assignment, 4=skin weight, 5=tangent
BYTE UsageIndex
BYTE Type // compression format (see below)
BYTE Offset // Offset into the vertex declaration for the data

Compression formats: 07 = 3 floats in 4 words. The fourth word is an unsigned scaler, multiply each signed word by 1/scaler (or use 512 if zero) 06 = 2 floats in two words. Multiply the signed values by 1/32767 05 = 3 floats in 4 bytes. Order is little-endian, use the low order byte (4th) as an unsigned scaler value. For each remaining signed byte, if negative, add it, if positive, subtract it, then multiple the result by 1/scaler, or by 1/127 if scaler is 0 04 = 4 small ints.


Sims 3:Main Page -> Sims 3:PackedFileTypes
Sims 3:Main Page -> Sims 3:RCOL

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox