1
2
3; sample script file
4
5; this script is used by TexConv to build a sample .tpl file
6; that demonstrates dolphin texture formats.
7
8; location: /cp/build/tools/TexConv/sample
9
10; to build, start the MS-DOS shell,
11; type cd \cp\build\tools\TexConv\sample
12; then \cp\X86\bin\TexConv sample.txt sample.tpl
13
14; view the sample.tpl file using texPrev2D.bin on your Mac.
15
16; problems? try the TexConv.exe debug version- it provides
17; many assert calls with printf error messages.
18
19
20; -------------------------
21
22
23path = /cp/build/tools/TexConv/sample/
24
25                                      ; sets directory path for subsequent source files.
26                                      ; use forward slash as directory separator.
27                                      ; end the path with a '/'
28                                      ; to cancel, type path = 0
29                                      ; then in file list, type full path + file name
30
31
32                                      ; for lists, the following rules apply:
33
34                                      ; indices start at 0
35                                      ; you may list files/images/palettes/textures
36                                      ; in any order.
37                                      ; variable spacing is permitted.
38
39
40; FILE LIST                           ; list of source files
41
42                                      ; we have provided a function to read .tga files.
43                                      ; it is up to the developer to provide functions to read other
44                                      ; file types ( see tplConv.h for how to install this code in TexConv )
45
46                                      ; all of these images are 128x128 texels
47
48file 0 = dolphin_32.tga               ; this is a 32-bit rgba image
49file 1 = pikachu_8.tga                ; this is an 8-bit color-indexed image with 256 entry 24-bit rgb palette
50file 2 = car_24.tga                   ; this is a 24-bit rgb image
51
52
53; -------------------------
54
55
56; IMAGE LIST
57                                      ; conversion formats are found in
58                                      ; dolphin/include/dolphin/gx/gxEnum.h
59                                      ; use enum definitions for GXCITexFmt, GXTexFmt, GXTlutFmt
60                                      ; and remove the GX_TF_, GX_TL_ prefix
61                                      ; ( example: GX_TF_RGBA8 becomes RGBA8 ).
62                                      ; not supported: C4, C14X2, 'Z' formats
63                                      ; and palette IA8 format.
64
65                                      ; the last 3 numbers are optional- they provide mipmap information.
66                                      ; if not mipmapping:  do not set these fields.
67                                      ; image can have any dimensions.
68
69                                      ; if mipmapping:  source image is considered to be LOD 0.
70                                      ; numbers indicate minLOD desired relative to source image,
71                                      ; maxLOD desired relative to source image, remapped minLOD.
72                                      ; remapped minLOD shifts the base of the mipmap pyramid.
73                                      ; ( minLOD in .tpl file = minLOD + remapMinLOD )
74                                      ; ( maxLOD in .tpl file = maxLOD + remapMinLOD )
75
76                                      ; image dimensions must be power of 2,
77                                      ; shortest dimension must be long enough to provide maxLOD.
78
79
80image    0 =  0, 0, RGBA8,  0, 7, 0   ; use color from file 0, alpha from file 0
81                                      ; convert to RGBA8 format
82                                      ; create 8 LODs total, starting at LOD 0
83                                      ; set the tpl minLOD to 0.
84
85
86image    1 =  0, 0, RGB5A3, 0, 7, 0
87image    2 =  0, 0, CMPR,   0, 7, 0   ; compressed format with source alpha reduced to 1-bit alpha.
88
89image    3 =  1, x, CI8               ; when source format is CI8 (file 2) and dest. format is CI8,
90                                      ; image has no alpha, cannot be mipmapped.
91                                      ; 'x' indicates unused component ( no alpha for this image )
92
93
94image    4 =  1, x, RGB565, 0, 7, 0   ; when source format is CI8 and dest. format is true color,
95                                      ; ( rgba, rgb, cmp, i, ia )
96                                      ; dest. images may have alpha and mipmaps.
97                                      ; note: if converting a C8 source file to true color format,
98                                      ; source file must contain both a color map and a palette.
99
100
101image    5 =  1, 0, RGBA8,  0, 7, 0   ; color and alpha info. come from different source files.
102                                      ; source image dimensions must be the same.
103
104image    6 =  2, x, RGBA8,  0, 7, 0   ; image 6 has no alpha channel: destination image will have
105                                      ; all alphas set to maximum value.
106
107image    7 =  2, x, RGB565, 0, 7, 0,
108image    8 =  2, x, CMPR,   0, 7, 0
109image    9 =  2, 0, RGB5A3, 0, 7, 0   ; color and alpha from different files.
110
111image   10 =  0, x, I4,     0, 7, 0   ; color images are reduced to greyscale by averaging color values.
112image   11 =  0, 0, IA4,    0, 7, 0
113image   12 =  2, x, I8,     0, 7, 0
114image   13 =  2, 0, IA8,    0, 7, 0
115
116                                      ; override default wrapS and wrapT mode in image 14 and 15
117                                      ; default is wrapS=wrapT=GX_REPEAT if both dimensions are power of two
118                                      ; otherwise, wrapS=wrapT=GX_CLAMP
119image   14 =  2, x, CMPR,   GX_REPEAT, GX_CLAMP          ; set wrapS to repeat and set wrapT to clamp
120image   15 =  2, x, CMPR,   0, 7, 0, GX_CLAMP, GX_MIRROR ; set wrapS to clamp and set wrapT to mirror w/ mipmap
121
122; -------------------------
123
124
125; PALETTE LIST
126                                      ; palettes can be converted to RGB565, RGB5A3 format.
127                                      ; if source palette lacks alpha and dest. is RGB5A3,
128                                      ; dest. alpha in CLUT will be set to maximum.
129
130
131palette 0  =  1,    RGB565            ; palette 0 is created from file 1.
132                                      ; input palettes must be 256-entries.
133
134
135; -------------------------
136
137
138; TEXTURE LIST
139
140
141texture 0  =  0, x                    ; texture 0 uses image 0, no palette
142texture 1  =  1, x
143texture 2  =  2, x
144texture 3  =  3, 0                    ; texture 3 uses image 3, palette 0
145texture 4  =  4, x
146texture 5  =  5, x
147texture 6  =  6, x
148texture 7  =  7, x
149texture 8  =  8, x
150texture 9  =  9, x
151texture 10 = 10, x
152texture 11 = 11, x
153texture 12 = 12, x
154texture 13 = 13, x
155texture 14 = 14, x
156texture 15 = 15, x
157
158
159; -------------------------