Difference between revisions of "Textureinformation Crash 2/3"
m (→Introduction) |
|||
Line 5: | Line 5: | ||
The format for the 12-byte structure consists of 3 consequent 32-bit integers and is as follows: | The format for the 12-byte structure consists of 3 consequent 32-bit integers and is as follows: | ||
− | YYYYYYYY YYYYXXXX BBBBBBBB AAAAAAAA | + | '''YYYYYYYY YYYYXXXX BBBBBBBB AAAAAAAA''' |
− | TTTTTTTT FCC0SSSS DDDDDDDD CCCCCCCC | + | '''TTTTTTTT FCC0SSSS DDDDDDDD CCCCCCCC''' |
− | HHHHHHHH GGGGGGGG FFFFFFFF EEEEEEEE | + | '''HHHHHHHH GGGGGGGG FFFFFFFF EEEEEEEE''' |
− | '''AAAAAAAA''' | + | The contents represent the following: |
+ | |||
+ | '''<u>AAAAAAAA</u>''' | ||
for triangle type “AA” and “BB”, mapping point 3 x | for triangle type “AA” and “BB”, mapping point 3 x | ||
Line 17: | Line 19: | ||
for triangle type “CC”, mapping point 1 x | for triangle type “CC”, mapping point 1 x | ||
− | '''BBBBBBBB''' | + | '''<u>BBBBBBBB</u>''' |
for triangle type “AA” and “BB”, mapping point 3 y | for triangle type “AA” and “BB”, mapping point 3 y | ||
Line 23: | Line 25: | ||
for triangle type “CC”, mapping point 1 y | for triangle type “CC”, mapping point 1 y | ||
− | XXXX | + | <u>XXXX</u> |
CLUT-line origin x coordinate (CLUT: Color LookUp Table, contain the colors for a specific texture) | CLUT-line origin x coordinate (CLUT: Color LookUp Table, contain the colors for a specific texture) | ||
− | '''YYYYYYYYYYYY''' | + | '''<u>YYYYYYYYYYYY</u>''' |
<nowiki> </nowiki>CLUT-line origin y coordinate | <nowiki> </nowiki>CLUT-line origin y coordinate | ||
− | The origin [x,y] for the CLUT-line is placed in a 16-bit interpretation of the texturechunk. | + | The origin [x,y] for the CLUT-line is placed in a 16-bit interpretation of the texturechunk. |
− | CLUT-line | + | 4-bit textures can have 2^4 = 16 different colors. Therefore the corresponding CLUT-line should always be 16 pixels long (in 16-bit!). |
− | |||
− | CLUT-line | + | 8-bit textures can have 2^8 = 256 different colors. Therefore the corresponding CLUT-line should always be 256 pixels long (in 16-bit!). |
− | |||
− | '''CCCCCCCC''' | + | '''<u>CCCCCCCC</u>''' |
mapping point 2 x | mapping point 2 x | ||
− | '''DDDDDDDD''' | + | '''<u>DDDDDDDD</u>''' |
mapping point 2 y | mapping point 2 y | ||
− | '''F '''Flag determined to define a 8 or 4-bit texture. 0 = 4-bit, 1 = 8-bit. | + | '''<u>F</u> ''' |
+ | |||
+ | Flag determined to define a 8 or 4-bit texture. 0 = 4-bit, 1 = 8-bit. | ||
− | '''CC''' | + | '''<u>CC</u>''' |
<nowiki> </nowiki>Colormode. | <nowiki> </nowiki>Colormode. | ||
Line 57: | Line 59: | ||
3 = standard face | 3 = standard face | ||
− | ''' | + | '''<u>0</u>''' |
− | |||
− | < | ||
− | |||
− | |||
− | + | Unused? | |
− | '''SSSS''' | + | '''<u>SSSS</u>''' |
− | + | Texturechunk segment index (0, 1, 2 or 3) | |
Each texturechunk in the original Crash games consists out of 4 | Each texturechunk in the original Crash games consists out of 4 | ||
Line 91: | Line 89: | ||
0 to 255 and are fixed. | 0 to 255 and are fixed. | ||
− | '''TTTTTTTT''' | + | '''<u>TTTTTTTT</u>''' |
refers to an offset from 0x0C in the header, for which textureslot to use (0-7 (i.e. 0x0 – 0x40 ) ) | refers to an offset from 0x0C in the header, for which textureslot to use (0-7 (i.e. 0x0 – 0x40 ) ) | ||
− | '''EEEEEEEE''' | + | '''<u>EEEEEEEE</u>''' |
for triangle type “AA” and “BB”, mapping point 1 x | for triangle type “AA” and “BB”, mapping point 1 x | ||
Line 101: | Line 99: | ||
for triangle type “CC”, mapping point 3 x | for triangle type “CC”, mapping point 3 x | ||
− | '''FFFFFFFF''' | + | '''<u>FFFFFFFF</u>''' |
for triangle type “AA” and “BB”, mapping point 1 y | for triangle type “AA” and “BB”, mapping point 1 y | ||
Line 109: | Line 107: | ||
'''scenery quads only:''' | '''scenery quads only:''' | ||
− | '''GGGGGGGG ''' | + | '''<u>GGGGGGGG</u> ''' |
mapping point 4 y | mapping point 4 y | ||
− | '''HHHHHHHH ''' | + | '''<u>HHHHHHHH</u> ''' |
mapping point 4 x | mapping point 4 x |
Revision as of 19:58, 6 August 2016
Introduction
In Crash 2/3, textureinformation contains information about a 3D model's UV coordinates, (animated) textures and colorpalettes. This information is stored in 12-byte structures in the 4th item of scenery and modelentries. The textureinformation can also be used by 'extended information', which is stored in the 7th item in sceneryentries or the 5th item in modelentries. Extended information can loop through multiple 12-byte structures to make animated textures, or provide settings for textures with different LOD's (Levels of Detail).
Textureinformation
The format for the 12-byte structure consists of 3 consequent 32-bit integers and is as follows:
YYYYYYYY YYYYXXXX BBBBBBBB AAAAAAAA
TTTTTTTT FCC0SSSS DDDDDDDD CCCCCCCC
HHHHHHHH GGGGGGGG FFFFFFFF EEEEEEEE
The contents represent the following:
AAAAAAAA
for triangle type “AA” and “BB”, mapping point 3 x
for triangle type “CC”, mapping point 1 x
BBBBBBBB
for triangle type “AA” and “BB”, mapping point 3 y
for triangle type “CC”, mapping point 1 y
XXXX
CLUT-line origin x coordinate (CLUT: Color LookUp Table, contain the colors for a specific texture)
YYYYYYYYYYYY
CLUT-line origin y coordinate
The origin [x,y] for the CLUT-line is placed in a 16-bit interpretation of the texturechunk.
4-bit textures can have 2^4 = 16 different colors. Therefore the corresponding CLUT-line should always be 16 pixels long (in 16-bit!).
8-bit textures can have 2^8 = 256 different colors. Therefore the corresponding CLUT-line should always be 256 pixels long (in 16-bit!).
CCCCCCCC
mapping point 2 x
DDDDDDDD
mapping point 2 y
F
Flag determined to define a 8 or 4-bit texture. 0 = 4-bit, 1 = 8-bit.
CC
Colormode. 0 = translucent face 1 = additive face 2 = subtractive face 3 = standard face
0
Unused?
SSSS
Texturechunk segment index (0, 1, 2 or 3)
Each texturechunk in the original Crash games consists out of 4 segments.
The 16-bit size of a texturechunk is 256 x 128
The 8-bit size of a texturechunk is 512 x 128
The 4-bit size of a texturechunk is 1024 x 128
Therefore, the segments in 16-, 8- and 4-bit mode are respectively:
- 64 x 128,
- 128 x 128
- 256 x 128
The segment index refers to the origin of the segment. The mapping points work relative from this origin. Note that the values of the mapping points are not effected by 8- or 4-bit mode. The x,y values range from 0 to 255 and are fixed.
TTTTTTTT
refers to an offset from 0x0C in the header, for which textureslot to use (0-7 (i.e. 0x0 – 0x40 ) )
EEEEEEEE
for triangle type “AA” and “BB”, mapping point 1 x
for triangle type “CC”, mapping point 3 x
FFFFFFFF
for triangle type “AA” and “BB”, mapping point 1 y
for triangle type “CC”, mapping point 3 y
scenery quads only:
GGGGGGGG
mapping point 4 y
HHHHHHHH
mapping point 4 x