TXTR (Tropical Freeze): Difference between revisions

Jump to navigation Jump to search
>Aruki
No edit summary
>Aruki
 
(10 intermediate revisions by the same user not shown)
Line 3: Line 3:
The '''TXTR''' format is Tropical Freeze's texture format. The image data in the GPU buffer is compressed using [[LZSS Compression|LZSS compression]].
The '''TXTR''' format is Tropical Freeze's texture format. The image data in the GPU buffer is compressed using [[LZSS Compression|LZSS compression]].


{{research|major|Most everything in the header + image compression formats needs to be cracked + documented.}}
{{research|moderate|There are a couple unknowns in the header. It would also be good to have some documentation on how to deswizzle/decompress different texture formats.}}


__TOC__
__TOC__
Line 13: Line 13:
{| class="wikitable"
{| class="wikitable"
! Offset
! Offset
! Type
! style="width:110px;"|Type
! Count
! style="width:100px;"|Count
! Name
! style="width:170px;"|Name
! Notes
! Notes
|-
|-
Line 28: Line 28:
| 1
| 1
| [[#Texture Type|'''Texture Type''']]
| [[#Texture Type|'''Texture Type''']]
|  
| Describes the type/dimensionality of the texture (2D texture, 3D texture, cubemap, array of 2D images, etc).
|-
|-
| 0x1C
| 0x1C
Line 34: Line 34:
| 1
| 1
| [[#Texture Format|'''Texture Format''']]
| [[#Texture Format|'''Texture Format''']]
|  
| Describes the format that the image data is encoded in.
|-
|-
| 0x20
| 0x20
Line 40: Line 40:
| 1
| 1
| '''Width'''
| '''Width'''
|  
| Texture X resolution.
|-
|-
| 0x24
| 0x24
Line 46: Line 46:
| 1
| 1
| '''Height'''
| '''Height'''
|  
| Texture Y resolution.
|-
|-
| 0x28
| 0x28
Line 52: Line 52:
| 1
| 1
| '''Depth'''
| '''Depth'''
|  
| Texture Z resolution.
|-
|-
| 0x2C
| 0x2C
| u32
| u32
| 1
| 1
| {{unknown|Unknown}}
| '''Tile Mode'''
|  
| Indicates how the texture image data is tiled.
|-
|-
| 0x30
| 0x30
Line 64: Line 64:
| 1
| 1
| '''Swizzle'''
| '''Swizzle'''
|  
| Indicates how the texture image data is swizzled.
|-
|-
| 0x34
| 0x34
Line 75: Line 75:
| u32
| u32
| ''Mipmap Count''
| ''Mipmap Count''
| {{unknown|Unknown array}}
| '''Mipmap Sizes'''
| Appears to be mipmap sizes, but it doesn't match the size of the image data (unless there's 1)...
| The size of the base level mipmap is calculated with padding and alignment taken into account. The size of subsequent mipmaps is calculated as Width*Height*Depth*BPP/8. This does '''not''' take padding and alignment into account, and so it does not accurately reflect the amount of space the mipmap takes up in the file, and it cannot be used to accurately locate and read mipmap data. The offset and size needs to be calculated from the other parameters in the header. The game calculates this data by calling GX2CalcSurfaceSizeAndAlignment.
|-
|-
| {{none}}
| {{none}}
Line 88: Line 88:
| 1
| 1
| [[#Texture Filter|'''Texture Filter''']]
| [[#Texture Filter|'''Texture Filter''']]
|  
| Determines how the texture is filtered when sampled.
|-
|-
| {{none}}
| {{none}}
| u8
| u8
| 1
| 1
| [[#Texture Wrap|'''Texture Wraps X''']]
| [[#Texture Wrap|'''Texture Wrap X''']]
|  
| Determines how the texture wraps on the X coordinate.
|-
|-
| {{none}}
| {{none}}
Line 100: Line 100:
| 1
| 1
| [[#Texture Wrap|'''Texture Wrap Y''']]
| [[#Texture Wrap|'''Texture Wrap Y''']]
|  
| Determines how the texture wraps on the Y coordinate.
|-
|-
| {{none}}
| {{none}}
Line 106: Line 106:
| 1
| 1
| [[#Texture Wrap|'''Texture Wrap Z''']]
| [[#Texture Wrap|'''Texture Wrap Z''']]
|  
| Determines how the texture wraps on the Z coordinate.
|}
|}


Line 115: Line 115:
{| class="wikitable"
{| class="wikitable"
! ID
! ID
! GX2SurfaceType
! Type
|-
|-
| 0
| 0
| GX2_SURFACE_DIM_1D
| 1D Texture
|-
|-
| 1
| 1
| GX2_SURFACE_DIM_2D
| 2D Texture
|-
|-
| 2
| 2
| GX2_SURFACE_DIM_3D
| 3D Texture
|-
|-
| 3
| 3
| GX2_SURFACE_DIM_CUBE
| Cube Texture
|-
|-
| 4
| 4
| GX2_SURFACE_DIM_1D_ARRAY
| 1D Texture Array
|-
|-
| 5
| 5
| GX2_SURFACE_DIM_2D_ARRAY
| 2D Texture Array
|-
|-
| 6
| 6
| GX2_SURFACE_DIM_2D_MSAA
| Multisampled 2D Texture
|-
|-
| 7
| 7
| GX2_SURFACE_DIM_2D_MSAA_ARRAY
| Multisampled 2D Texture Array
|}
|}


Line 302: Line 302:
| 1
| 1
| {{unknown|Unknown}}
| {{unknown|Unknown}}
|  
| Always 4
|-
|-
| 0x4
| 0x4
Line 319: Line 319:
| u32
| u32
| 1
| 1
| {{unknown|Unknown}}
| '''Base Alignment'''
|  
| Alignment of the surface image data
|-
|-
| 0x10
| 0x10
Anonymous user

Navigation menu