Difference between revisions of "Sims 3:0x01D0E723"

From SimsWiki
Jump to: navigation, search
Line 6: Line 6:
 
}}
 
}}
 
<br clear="all">
 
<br clear="all">
==Vertex Format ==
+
==Format==
 
This is a [[Sims 3:RCOL]] chunk found embedded in [[Sims 3:0x01661233|MODL]] and [[Sims 3:0x01D10F34|MLOD]] resources.
 
This is a [[Sims 3:RCOL]] chunk found embedded in [[Sims 3:0x01661233|MODL]] and [[Sims 3:0x01D10F34|MLOD]] resources.
  DWORD // 'VRTF'
+
  DWORD Tag // 'VRTF'
  DWORD // 00000002
+
  DWORD Version // 00000002
  DWORD // Vertex data length (Bytes per vertex)
+
  DWORD Stride // Vertex data length (Bytes per vertex)
 
  DWORD // Declaration count
 
  DWORD // Declaration count
  DWORD // Unknown (0)
+
  DWORD IsExtendedFormat// boolean, always false but were it true the byte fields ahead would be DWORDs
 
+
 
  For each count vertex declaration, a packed form of [http://msdn.microsoft.com/en-us/library/bb172630(VS.85).aspx D3DVERTEXELEMENT]
 
  For each count vertex declaration, a packed form of [http://msdn.microsoft.com/en-us/library/bb172630(VS.85).aspx D3DVERTEXELEMENT]
  BYTE Usage // 0=position, 1=normal, 2=UV, 3=assignment, 4=skin weight, 5=tangent, 6=unknown element type
+
  BYTE [[#Element_Usages|Usage]]
  BYTE UsageIndex
+
  BYTE UsageIndex //some elements can appear more than once, each time the index increases
  BYTE Type // compression format (see below)
+
  BYTE [[#Element_Formats|Format]]
 
  BYTE Offset // Offset into the vertex declaration for the data
 
  BYTE Offset // Offset into the vertex declaration for the data
  
<pre>
+
==Element Usages==
Compression formats:
+
Usages, and the formats they are usually paired with.
07 = 3 floats in 4 words. The fourth word is an unsigned scaler, multiply each signed word by 1/scaler (or use 65535 if zero)
+
{| class="wikitable" border="1" ! colspan="3"
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
+
!Id
04 = 4 small ints.
+
!Type
</pre>
+
!Element Formats
 +
|-
 +
|0x00 || Position || Short4
 +
|-
 +
|0x01 || Normal || ColorUByte4
 +
|-
 +
|0x02 || UV || Short2, Short4
 +
|-
 +
|0x03 || BlendIndex|| UByte4
 +
|-
 +
|0x04 || BlendWeight|| ColorUByte4
 +
|-
 +
|0x05 || Tangent|| ColorUByte4
 +
|-
 +
|0x06 || Color|| ColorUByte4
 +
|}
 +
==Element Formats==
 +
List of formats, and how to read them
 +
{| class="wikitable" border="1" ! colspan="3"
 +
|-
 +
!Id
 +
!Type
 +
!
 +
|-
 +
|0x00 || Float || uncompressed float
 +
|-
 +
|0x01 || Float2 || 2 uncompressed floats
 +
|-
 +
|0x02 || Float3 || 3 uncompressed floats
 +
|-
 +
|0x03 || Float4 || 4 uncompressed floats
 +
|-
 +
|0x04 || UByte4 || 4 uncompressed bytes
 +
|-
 +
|0x05 || ColorUByte4 || 3 floats in 4 bytes. Order is little-endian, use the low order
 +
|-
 +
|0x06 || Short2 || 2 floats in two words. Multiply the signed values by 1/32767
 +
|-
 +
|0x07 || Short4 || 3 floats in 4 words. The fourth word is an unsigned scaler
 +
|-
 +
|0x08 || UByte4N||
 +
|-
 +
|0x09 || Short2N||
 +
|-
 +
|0x0A || Short4N||
 +
|-
 +
|0x0B || UShort2N ||
 +
|-
 +
|0x0C || UShort4N ||
 +
|-
 +
|0x0D || Dec3N ||
 +
|-
 +
|0x0E || UDec3N ||
 +
|-
 +
|0x0F || Float16_2 ||
 +
|-
 +
|0x10 || Float16_4 ||
 +
|-
 +
|}
 +
 
  
 
Based on contributions from delphy, karybdis and atavera
 
Based on contributions from delphy, karybdis and atavera
  
 
{{TS3AdvancedModdingHeader}}
 
{{TS3AdvancedModdingHeader}}

Revision as of 04:18, 5 December 2010

Modding Reference by Category

Sims 3 :DBPF | File Types | RCOL(Scene) | Catalog Resource | String Table | Key Table | TS3 Programmer's Reference 

Vertex Format - VRTF
TypeID:0x01D0E723
Game Version:The Sims 3



Format

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

DWORD Tag // 'VRTF'
DWORD Version // 00000002
DWORD Stride // Vertex data length (Bytes per vertex)
DWORD // Declaration count
DWORD IsExtendedFormat// boolean, always false but were it true the byte fields ahead would be DWORDs

For each count vertex declaration, a packed form of D3DVERTEXELEMENT
BYTE Usage
BYTE UsageIndex //some elements can appear more than once, each time the index increases
BYTE Format
BYTE Offset // Offset into the vertex declaration for the data

Element Usages

Usages, and the formats they are usually paired with.

Id Type Element Formats
0x00 Position Short4
0x01 Normal ColorUByte4
0x02 UV Short2, Short4
0x03 BlendIndex UByte4
0x04 BlendWeight ColorUByte4
0x05 Tangent ColorUByte4
0x06 Color ColorUByte4

Element Formats

List of formats, and how to read them

Id Type
0x00 Float uncompressed float
0x01 Float2 2 uncompressed floats
0x02 Float3 3 uncompressed floats
0x03 Float4 4 uncompressed floats
0x04 UByte4 4 uncompressed bytes
0x05 ColorUByte4 3 floats in 4 bytes. Order is little-endian, use the low order
0x06 Short2 2 floats in two words. Multiply the signed values by 1/32767
0x07 Short4 3 floats in 4 words. The fourth word is an unsigned scaler
0x08 UByte4N
0x09 Short2N
0x0A Short4N
0x0B UShort2N
0x0C UShort4N
0x0D Dec3N
0x0E UDec3N
0x0F Float16_2
0x10 Float16_4


Based on contributions from delphy, karybdis and atavera

Modding Reference by Category

Sims 3 :DBPF | File Types | RCOL(Scene) | Catalog Resource | String Table | Key Table | TS3 Programmer's Reference 

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox