Difference between revisions of "Sims 3:0x033A1435"

From SimsWiki
Jump to: navigation, search
(Properties)
 
(42 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{TS3AdvancedModdingHeader}}
 +
{{TS3Resource
 +
|name=Texture Compositor - TXTC
 +
|typeid= 0x033A1435
 +
|expansion=The Sims 3
 +
}}
 +
<br clear="all">
 +
 
==Overview==
 
==Overview==
This format is internally known as the "TextureCompositor".
+
This format is internally known as the "TextureCompositor".  It describes the process of combining various texture files into what is actually rendered in the game.  Texture Steps are to be read sequentially, as the previous ones affect the ones that follow.  Sources are generally external textures referenced by an image key, destination represents the render texture specified by the steps, thus a virtual texture.
 
==Format==
 
==Format==
Property sets
+
DWORD // Version
 +
DWORD // Offset of the I<sub>64</sub>GT Count from the end of this DWORD
 +
 +
--if ''Version'' >= 7
 +
BYTE EmbeddedTxtcCount
 +
--repetition(EmbeddedTxtcCount)
 +
BYTE // TGI index for this embedded txtc's resource key
 +
DWORD // byte size of this embedded txtc
 +
--Insert another TXTC
 +
BYTE[3] // don't know but seems needed
 +
 +
DWORD [[#Pattern_Size|Pattern Size]]
 +
DWORD [[Sims_3:CAS_Part_Flags#Type|PartType]]
 +
BYTE //00
 +
DWORD // entry count
 +
 +
--if ''Version'' >= 8
 +
BYTE //00
 +
 +
--repetition(entry count)
 +
{Entry} // [[#Entry Format|see below]]
 +
 +
BYTE // I<sub>64</sub>GT Count
 +
--repetition(I<sub>64</sub>GT Count)
 +
I<sub>64</sub>GT
 +
===Entry format===
 +
An "entry" is made up of a repeating group, as follows:
 +
--Repeat until the next "property id" is 0x00000000
 +
DWORD // Property ID - see [[#Properties|Properties]] below
 +
BYTE // 0x00
 +
BYTE // Data type - see [[#Data Types|Data types]] below
 +
{Data} //
 +
DWORD // 0x00000000 the next "property id"; not a full entry group
  
<pre>
+
by Karybdis
DWORD - Version
+
DWORD - Offset of the TGI Block (+8)
+
(Version 7+) BYTE - Main Superblock count
+
  
-Main Superblocks (Version 7+ only)
+
====Pattern Size====
BYTE - Some sort of 0 based index (sequential in superblocks)
+
{| class="wikitable" border="1"
DWORD Offset from end of this DWORD to the beginning of the next superblock
+
|-
DWORD (8)
+
| 0x00000000 || Default
DWORD - Offset from end of this DWORD to the end of the entries (from there, 1 DWORD to the next superblock)
+
|-
10 BYTES Blank
+
| 0x00000001 || Large
DWORD - Entry count in this superblock
+
|}
BYTE
+
--Entries (repeat entrycount times)
+
DWORD
+
 
+
-Endblock Section (All versions)
+
DWORD
+
DWORD
+
BYTE
+
DWORD - entry count
+
(Version 8+) BYTE
+
--Entries (repeat entrycount times)
+
 
+
-TGI's
+
BYTE - TGI Count
+
TGI (Repeat Count Times)
+
 
+
-----
+
 
+
--ENTRIES format (repeat entry count times)
+
(DWORD)Property ID - (BYTE)Typecode - (variable)Data (Repeat this format using the code list above until the next property id is 0x00000000. Then end entry.
+
</pre>
+
  
==Step Types==
+
====Properties====
{| border="1"
+
Property IDs are derived from an internal name hashed with the [[FNV|FNV32]] algorithm.
! ID
+
{| class="wikitable sortable" border="1"
! Name
+
|- Sortable table
! Description
+
! ID !! Name !! Description !! DataType
 
|-
 
|-
| 0x9CD1269D
+
| 0x048F7567 || Destination Blend || See [[#Blend Factors|Blend Factors]] below || 0x03
| Colour Fill
+
|  
+
 
|-
 
|-
| 0xD6BD8695
+
| 0x06A775CE || Skip Shader Model || See [[#Shader Models|Shader Models]] below. || 0x03
| Set Target
+
|  
+
 
|-
 
|-
| 0x1E363B9B
+
| 0x10DA0B6A || Mask Source || ||  
| Channel Select
+
|  
+
 
|-
 
|-
| 0x034210A5
+
| 0x182E64EB || Width || || 0x07
| Draw Fabric
+
|  
+
 
|-
 
|-
| 0xA15200B1
+
| 0x1F091259 || Mask Select || || 0x0B
| Draw Image
+
|  
+
 
|-
 
|-
| 0xC6B6AC1F
+
| 0x2EDF5F53 || Min Shader Model || || 0x03
| CAS Pick Data
+
|  
+
 
|-
 
|-
| 0xDC0984B9
+
| 0x331178DF || Skip Detail Level || See [[#Detail Levels|Detail Levels]] below|| 0x07
| HSV to RGB
+
|  
+
 
|-
 
|-
| 0x43B554E3
+
| 0x3A3260E6 || Mask Bias || || 0x09
| Skin Tone
+
|  
+
 
|-
 
|-
| 0x5D7C85D4
+
| 0x49DE3B16 || Mask Key || || 0x0C
| Hair Tone
+
|-
|  
+
| 0x49F996DB || Rotation || || 0x09
 +
|-
 +
| 0x4C47D5C0 || Height || || 0x07
 +
|-
 +
| 0x64399EC5 || Default Colour ||  || 0x07
 +
|-
 +
| 0x687720A6 || ID || See [[#Step Types|Step Types]] below.|| 0x07
 +
|-
 +
| 0x6B7119C1 || Description || || 0x0D
 +
|-
 +
| 0x8A7006DB || Image Source || See [[#Render Targets|Render Targets]] below || 0x07
 +
|-
 +
| 0xA2C91332 || Render Target || See [[#Render Targets|Render Targets]] below || 0x07
 +
|-
 +
| 0xA3AAFC98 || Source Rectangle || || 0x0A
 +
|-
 +
| 0xAE5FE82A || Min Detail Level || See [[#Detail Levels|Detail Levels]] below || 0x07
 +
|-
 +
| 0xB01748DA || Colour || || 0x07
 +
|-
 +
| 0xB07B3B93 || Colour Write ||See [[#Colour Write Flags|Colour Write Flags]] below || 0x03
 +
|-
 +
| 0xB67C2EF8 || HSV Shift || || 0x0B
 +
|-
 +
| 0xD0E69002 || Channel Select || || 0x0B
 +
|-
 +
| 0xD92A4C8B || UI Visible || || 0x00
 +
|-
 +
| 0xD49E8879 || ? || ? || 0x00
 +
|-
 +
| 0xDCFF6D7B || Default Fabric || References embedded superblock || 0x0C
 +
|-
 +
| 0xE055EE36 || Source Blend || See [[#Blend Factors|Blend Factors]] below || 0x03
 +
|-
 +
| 0xE1D6D01F || Destination Rectangle || || 0x0A
 +
|-
 +
| 0xE27FE962 || Enable Filtering ||  || 0x00
 +
|-
 +
| 0xF6CC8471 || Image Key || || 0x0C
 +
|-
 +
| 0xFBF310C7 || Enable Blending || Indicative whether or not there will be Source/Destination blend parameters || 0x00
 +
|-
 +
|}
 +
=====Step Types=====
 +
These are the known values for the ID field of the properties.  The ID is derived from a [[FNV|FNV32]] hashed internal name.
 +
{| class="wikitable" border="1"
 +
! ID !! Name !! Description
 +
|-
 +
| 0x034210A5 || Draw Fabric || Draws an embedded fabric txtc.  This comes from Default fabric parameter, which has overrides all over the place
 +
|-
 +
| 0x1E363B9B || Channel Select || Masks future steps based upon the colour from the "Channel Select" parameter using the mask texture in the "Image Key"
 +
|-
 +
| 0x43B554E3 || Skin Tone ||
 +
|-
 +
| 0x5D7C85D4 || Hair Tone ||
 +
|-
 +
| 0x890805DB || Remapped Channel Select ||
 +
|-
 +
| 0x9CD1269D || Colour Fill || Fills the texture buffer with a colour, this is often limited to a masked channel
 +
|-
 +
| 0xA15200B1 || Draw Image || Draws an image to the buffer, this is affected by masked colour channels, src/dest rectangles and src/dest blend factors
 +
|-
 +
| 0xC6B6AC1F || CAS Pick Data ||
 +
|-
 +
| 0xD6BD8695 || Set Target || Sets which render target future steps will use
 +
|-
 +
| 0xDC0984B9 || HSV to RGB ||  
 
|-
 
|-
 
|}
 
|}
  
==Properties==
+
=====Detail Levels=====
{| border="1"
+
This is not an enumeration, rather min/max constants defined by EA
! ID
+
{| class="wikitable" border="1"
! Name
+
! ID !! Name !! Description
! Description
+
 
|-
 
|-
| 0xB01748DA
+
| 0x00000000|| Lowest ||
| Colour
+
|
+
 
|-
 
|-
| 0x4C47D5C0
+
| 0x00000003|| Highest ||
| Height
+
|  
+
 
|-
 
|-
| 0x182E64EB
+
|}
| Width
+
 
|  
+
=====Shader Models=====
 +
{| class="wikitable" border="1"
 +
! ID !! Name !! Description
 
|-
 
|-
| 0x49F996DB
+
| 0x00000000|| SM_1_0 ||
| Rotation
+
|  
+
 
|-
 
|-
| 0xD0E69002
+
| 0x00000001|| SM_1_1 ||
| Channel Select
+
|  
+
 
|-
 
|-
| 0xB67C2EF8
+
| 0x00000002|| SM_2_0 ||
| HSV Shift
+
|  
+
 
|-
 
|-
| 0x3A3260E6
+
| 0x00000003|| SM_2_1 ||
| Mask Bias
+
|  
+
 
|-
 
|-
| 0x1F091259
+
| 0x7FFFFFFF|| SM_Highest ||
| Mask Select
+
|  
+
 
|-
 
|-
| 0x49DE3B16
+
|}
| Mask Key
+
 
|  
+
 
 +
=====Render Textures=====
 +
{| class="wikitable" border="1"
 +
! ID !! Name !! Description
 
|-
 
|-
| 0x10DA0B6A
+
| 0x21E9CD3|| RenderTexture_A ||
| Mask Source
+
|  
+
 
|-
 
|-
| 0x6B7119C1
+
| 0x21E9CD5|| RenderTexture_B ||
| Description
+
|  
+
 
|-
 
|-
| 0xD92A4C8B
+
|}
| UI Visible
+
 
|  
+
 
 +
 
 +
=====Render Targets=====
 +
Analogous to [http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.rendertarget%28v=xnagamestudio.31%29.aspx .NET Render Targets]
 +
{| class="wikitable" border="1"
 +
! ID !! Name !! Description
 
|-
 
|-
| 0x2EDF5F53
+
| 0x21E9CD2|| RenderTarget_A ||
| Min Shader Model
+
|  
+
 
|-
 
|-
| 0x06A775CE
+
| 0x21E9CD4|| RenderTarget_B ||
| Skip Shader Model
+
|  
+
 
|-
 
|-
| 0xAE5FE82A
+
|}
| Min Detail Level
+
 
|  
+
 
 +
 
 +
 
 +
=====Colour Write Flags=====
 +
Filters colour channels that are used in a step
 +
{| class="wikitable" border="1"
 +
! ID !! Name !! Description
 
|-
 
|-
| 0x331178DF
+
| 0x00000001|| Red ||
| Skip Detail Level
+
|  
+
 
|-
 
|-
| 0xF6CC8471
+
| 0x00000002|| Green ||
| Image Key
+
|  
+
 
|-
 
|-
| 0xDCFF6D7B
+
| 0x00000004|| Blue ||
| Default Fabric
+
|  
+
 
|-
 
|-
| 0xB07B3B93
+
| 0x00000008|| Alpha ||
| Colour Write
+
|  
+
 
|-
 
|-
| 0xE1D6D01F
+
|}
| Destination Rectangle
+
 
|  
+
=====Blend Factors=====
 +
Analogous to [http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.blend.aspx .NET Blend Factors]
 +
{| class="wikitable" border="1"
 +
! ID !! Name !! Description
 
|-
 
|-
| 0xFBF310C7
+
| 0x00000000|| Zero ||
| Enable Blending
+
|  
+
 
|-
 
|-
| 0x048F7567
+
| 0x00000001|| One ||
| Destination Blend
+
|  
+
 
|-
 
|-
| 0xE055EE36
+
| 0x00000002|| Source Colour||
| Source Blend
+
|  
+
 
|-
 
|-
| 0xA2C91332
+
| 0x00000003|| Inverse Source Colour||
| Render Target
+
|  
+
 
|-
 
|-
| 0xA3AAFC98
+
| 0x00000004|| Source Alpha||
| Source Rectangle
+
|  
+
 
|-
 
|-
| 0x8A7006DB
+
| 0x00000005|| Inverse Source Alpha ||
| Image Source
+
|  
+
 
|-
 
|-
| 0xE27FE962
+
| 0x00000006|| Destination Alpha ||
| Enable Filtering
+
|
+
 
|-
 
|-
| 0x64399EC5
+
| 0x00000007|| Inverse Destination Alpha ||
| Default Colour
+
|-
|
+
| 0x00000008|| Destination Colour ||
 +
|-
 +
| 0x00000009|| Inverse Destination Colour ||
 +
|-
 +
| 0x0000000A|| Source Alpha Saturation ||
 +
|-
 +
| 0x0000000B|| Blend Factor ||
 +
|-
 +
| 0x0000000C|| Inverse Blend Factor ||
 
|-
 
|-
 
|}
 
|}
  
 
+
====Data Types====
==Data Types==
+
{| class="wikitable" border="1"
{| border="1"
+
! Typecode !! Data !! Comment
! ID
+
! Length
+
! Type
+
 
|-
 
|-
| 0x00
+
| 0x00 || BYTE || boolean
| 1
+
| bool
+
 
|-
 
|-
| 0x01
+
| 0x01 || BYTE || signed
| 1
+
| sbyte
+
 
|-
 
|-
| 0x02
+
| 0x02 || WORD || signed short
| 2
+
| short
+
 
|-
 
|-
| 0x03
+
| 0x03 || DWORD || signed int
| 4
+
| int
+
 
|-
 
|-
| 0x04
+
| 0x04 || QWORD || signed long int
| 8
+
| long
+
 
|-
 
|-
| 0x05
+
| 0x05 || BYTE || unsigned
| 1
+
| byte
+
 
|-
 
|-
| 0x06
+
| 0x06 || WORD || unsigned short
| 2
+
| ushort
+
 
|-
 
|-
| 0x07
+
| 0x07 || DWORD || unsigned int (e.g. step type)
| 4
+
| uint
+
 
|-
 
|-
| 0x08
+
| 0x08 || QWORD || unsigned long int
| 8
+
| ulong
+
 
|-
 
|-
| 0x09
+
| 0x09 || FLOAT ||
| 4
+
| float
+
 
|-
 
|-
| 0x0A
+
| 0x0A || FLOAT[4] || RectFloat
| 16
+
| (float[4])RectFloat
+
 
|-
 
|-
| 0x0B
+
| 0x0B || FLOAT[4] || Vector4
| 16
+
| (float[4])Vector4
+
 
|-
 
|-
| 0x0C
+
| 0x0C || BYTE || Index into TGI<sub>64</sub> table
| 1
+
| (byte)ResourceKey
+
 
|-
 
|-
| 0x0D
+
| 0x0D || WORD len, string[len] ||
| 1+N
+
| string
+
 
|}
 
|}
 +
 +
{{TS3AdvancedModdingHeader}}

Latest revision as of 21:29, 13 February 2012

Modding Reference by Category

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

Texture Compositor - TXTC
TypeID:0x033A1435
Game Version:The Sims 3



Contents

[edit] Overview

This format is internally known as the "TextureCompositor". It describes the process of combining various texture files into what is actually rendered in the game. Texture Steps are to be read sequentially, as the previous ones affect the ones that follow. Sources are generally external textures referenced by an image key, destination represents the render texture specified by the steps, thus a virtual texture.

[edit] Format

DWORD	// Version
DWORD	// Offset of the I64GT Count from the end of this DWORD

--if Version >= 7
	BYTE EmbeddedTxtcCount
	--repetition(EmbeddedTxtcCount)
		BYTE	// TGI index for this embedded txtc's resource key		
		DWORD	// byte size of this embedded txtc
		--Insert another TXTC
		BYTE[3]	// don't know but seems needed

DWORD Pattern Size
DWORD PartType
BYTE //00
DWORD	// entry count

--if Version >= 8
	BYTE //00

--repetition(entry count)
	{Entry}	// see below

BYTE	// I64GT Count
--repetition(I64GT Count)
	I64GT

[edit] Entry format

An "entry" is made up of a repeating group, as follows:

--Repeat until the next "property id" is 0x00000000
	DWORD	// Property ID - see Properties below
	BYTE	// 0x00
	BYTE	// Data type - see Data types below
	{Data}	// 
DWORD		// 0x00000000 the next "property id"; not a full entry group

by Karybdis

[edit] Pattern Size

0x00000000 Default
0x00000001 Large

[edit] Properties

Property IDs are derived from an internal name hashed with the FNV32 algorithm.

ID Name Description DataType
0x048F7567 Destination Blend See Blend Factors below 0x03
0x06A775CE Skip Shader Model See Shader Models below. 0x03
0x10DA0B6A Mask Source
0x182E64EB Width 0x07
0x1F091259 Mask Select 0x0B
0x2EDF5F53 Min Shader Model 0x03
0x331178DF Skip Detail Level See Detail Levels below 0x07
0x3A3260E6 Mask Bias 0x09
0x49DE3B16 Mask Key 0x0C
0x49F996DB Rotation 0x09
0x4C47D5C0 Height 0x07
0x64399EC5 Default Colour 0x07
0x687720A6 ID See Step Types below. 0x07
0x6B7119C1 Description 0x0D
0x8A7006DB Image Source See Render Targets below 0x07
0xA2C91332 Render Target See Render Targets below 0x07
0xA3AAFC98 Source Rectangle 0x0A
0xAE5FE82A Min Detail Level See Detail Levels below 0x07
0xB01748DA Colour 0x07
0xB07B3B93 Colour Write See Colour Write Flags below 0x03
0xB67C2EF8 HSV Shift 0x0B
0xD0E69002 Channel Select 0x0B
0xD92A4C8B UI Visible 0x00
0xD49E8879  ?  ? 0x00
0xDCFF6D7B Default Fabric References embedded superblock 0x0C
0xE055EE36 Source Blend See Blend Factors below 0x03
0xE1D6D01F Destination Rectangle 0x0A
0xE27FE962 Enable Filtering 0x00
0xF6CC8471 Image Key 0x0C
0xFBF310C7 Enable Blending Indicative whether or not there will be Source/Destination blend parameters 0x00
[edit] Step Types

These are the known values for the ID field of the properties. The ID is derived from a FNV32 hashed internal name.

ID Name Description
0x034210A5 Draw Fabric Draws an embedded fabric txtc. This comes from Default fabric parameter, which has overrides all over the place
0x1E363B9B Channel Select Masks future steps based upon the colour from the "Channel Select" parameter using the mask texture in the "Image Key"
0x43B554E3 Skin Tone
0x5D7C85D4 Hair Tone
0x890805DB Remapped Channel Select
0x9CD1269D Colour Fill Fills the texture buffer with a colour, this is often limited to a masked channel
0xA15200B1 Draw Image Draws an image to the buffer, this is affected by masked colour channels, src/dest rectangles and src/dest blend factors
0xC6B6AC1F CAS Pick Data
0xD6BD8695 Set Target Sets which render target future steps will use
0xDC0984B9 HSV to RGB
[edit] Detail Levels

This is not an enumeration, rather min/max constants defined by EA

ID Name Description
0x00000000 Lowest
0x00000003 Highest
[edit] Shader Models
ID Name Description
0x00000000 SM_1_0
0x00000001 SM_1_1
0x00000002 SM_2_0
0x00000003 SM_2_1
0x7FFFFFFF SM_Highest


[edit] Render Textures
ID Name Description
0x21E9CD3 RenderTexture_A
0x21E9CD5 RenderTexture_B


[edit] Render Targets

Analogous to .NET Render Targets

ID Name Description
0x21E9CD2 RenderTarget_A
0x21E9CD4 RenderTarget_B



[edit] Colour Write Flags

Filters colour channels that are used in a step

ID Name Description
0x00000001 Red
0x00000002 Green
0x00000004 Blue
0x00000008 Alpha
[edit] Blend Factors

Analogous to .NET Blend Factors

ID Name Description
0x00000000 Zero
0x00000001 One
0x00000002 Source Colour
0x00000003 Inverse Source Colour
0x00000004 Source Alpha
0x00000005 Inverse Source Alpha
0x00000006 Destination Alpha
0x00000007 Inverse Destination Alpha
0x00000008 Destination Colour
0x00000009 Inverse Destination Colour
0x0000000A Source Alpha Saturation
0x0000000B Blend Factor
0x0000000C Inverse Blend Factor

[edit] Data Types

Typecode Data Comment
0x00 BYTE boolean
0x01 BYTE signed
0x02 WORD signed short
0x03 DWORD signed int
0x04 QWORD signed long int
0x05 BYTE unsigned
0x06 WORD unsigned short
0x07 DWORD unsigned int (e.g. step type)
0x08 QWORD unsigned long int
0x09 FLOAT
0x0A FLOAT[4] RectFloat
0x0B FLOAT[4] Vector4
0x0C BYTE Index into TGI64 table
0x0D WORD len, string[len]
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