gfxstatic.c
6.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
/*====================================================================
* gfxstatic.c
*
* Synopsis:
*
* Datafiles obtained from Multigen flt demo directory.
*
* Copyright 1993, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
* Inc.; the contents of this file may not be disclosed to third
* parties, copied or duplicated in any form, in whole or in part,
* without the prior written permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
* in Technical Data and Computer Software clause at DFARS
* 252.227-7013, and/or in similar or successor clauses in the FAR,
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
* Copyright Laws of the United States.
*====================================================================*/
#include <ultra64.h>
#include "gfx.h"
#include "sphere10.h"
#include "sphere12.h"
#include "sphere17.h"
#include "mahogany.h"
Gfx sphere10[] = {
#include "sphere10.c"
gsSPEndDisplayList(),
};
Gfx sphere12[] = {
#include "sphere12.c"
gsSPEndDisplayList(),
};
Gfx sphere17[] = {
#include "sphere17.c"
gsSPEndDisplayList(),
};
/*
* The sun (uses sphere3 since assumes sun will be far away)
*/
#define SUN_AMBIENT_R 250
#define SUN_AMBIENT_G 250
#define SUN_AMBIENT_B 0
#define SUN_DIFFUSE_R 250
#define SUN_DIFFUSE_G 250
#define SUN_DIFFUSE_B 0
#define SUN_DIR_X 0
#define SUN_DIR_Y -127
#define SUN_DIR_Z 0
Lights1 sunLight = gdSPDefLights1(
SUN_AMBIENT_R, SUN_AMBIENT_G, SUN_AMBIENT_B,
0, 0, 0,
SUN_DIR_X, SUN_DIR_Y, SUN_DIR_Z);
Gfx sun_dl[] = {
gsDPPipeSync(),
gsSPClearGeometryMode(0xffffffff),
gsSPSetGeometryMode(G_ZBUFFER | G_CULL_BACK | G_LIGHTING |
G_SHADE | G_SHADING_SMOOTH),
gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, SCREEN_WD, SCREEN_HT),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetCombineKey(G_CK_NONE),
gsDPSetAlphaCompare(G_AC_NONE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsSPSetLights1(sunLight),
gsSPDisplayList(sphere12),
gsSPEndDisplayList(),
};
/*
* Mercury planet
*/
#define MERCURY_AMBIENT_R 128
#define MERCURY_AMBIENT_G 8
#define MERCURY_AMBIENT_B 0
Lights1 mercuryLight = gdSPDefLights1(
MERCURY_AMBIENT_R, MERCURY_AMBIENT_G, MERCURY_AMBIENT_B,
SUN_DIFFUSE_R, SUN_DIFFUSE_G, SUN_DIFFUSE_B,
-56, -113, 0);
Gfx mercury_dl[] = {
gsDPPipeSync(),
gsSPClearGeometryMode(0xffffffff),
gsSPSetGeometryMode(G_ZBUFFER | G_CULL_BACK | G_LIGHTING |
G_SHADE | G_SHADING_SMOOTH),
gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, SCREEN_WD, SCREEN_HT),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetCombineKey(G_CK_NONE),
gsDPSetAlphaCompare(G_AC_NONE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_OFF),
gsSPSetLights1(mercuryLight),
gsSPDisplayList(sphere12),
gsSPEndDisplayList(),
};
/*
* Venus planet
*/
#define VENUS_AMBIENT_R 25
#define VENUS_AMBIENT_G 75
#define VENUS_AMBIENT_B 50
Lights1 venusLight = gdSPDefLights1(
VENUS_AMBIENT_R, VENUS_AMBIENT_G, VENUS_AMBIENT_B,
SUN_DIFFUSE_R, SUN_DIFFUSE_G, SUN_DIFFUSE_B,
-65, -108, 0);
Gfx venus_dl[] = {
gsDPPipeSync(),
gsSPClearGeometryMode(0xffffffff),
gsSPSetGeometryMode(G_ZBUFFER | G_CULL_BACK | G_LIGHTING |
G_SHADE | G_SHADING_SMOOTH),
gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, SCREEN_WD, SCREEN_HT),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetCombineKey(G_CK_NONE),
gsDPSetAlphaCompare(G_AC_NONE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsSPSetLights1(venusLight),
gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode (G_CC_MODULATERGBA, G_CC_MODULATERGBA),
gsDPSetTexturePersp (G_TP_PERSP),
gsDPSetTextureDetail (G_TD_CLAMP),
gsDPSetTextureLOD (G_TL_TILE),
gsDPSetTextureLUT (G_TT_NONE),
gsDPSetTextureFilter (G_TF_BILERP),
gsDPSetTextureConvert(G_TC_FILT),
gsDPLoadTextureBlock (mahogany, G_IM_FMT_IA, G_IM_SIZ_16b, 32, 32, 0,
G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR,
5, 5, 3, 4),
gsSPDisplayList(sphere10),
gsSPEndDisplayList(),
};
/*
* Earth planet
*/
#define EARTH_AMBIENT_R 61
#define EARTH_AMBIENT_G 74
#define EARTH_AMBIENT_B 157
Lights1 earthLight = gdSPDefLights1(
EARTH_AMBIENT_R, EARTH_AMBIENT_G, EARTH_AMBIENT_B,
SUN_DIFFUSE_R, SUN_DIFFUSE_G, SUN_DIFFUSE_B,
65, -108, 0);
Gfx earth_dl[] = {
gsDPPipeSync(),
gsSPClearGeometryMode(0xffffffff),
gsSPSetGeometryMode(G_ZBUFFER | G_CULL_BACK | G_LIGHTING |
G_SHADE | G_SHADING_SMOOTH),
gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, SCREEN_WD, SCREEN_HT),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetCombineKey(G_CK_NONE),
gsDPSetAlphaCompare(G_AC_NONE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsSPSetLights1(earthLight),
gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode (G_CC_MODULATERGBA, G_CC_MODULATERGBA),
gsDPSetTexturePersp (G_TP_PERSP),
gsDPSetTextureDetail (G_TD_CLAMP),
gsDPSetTextureLOD (G_TL_TILE),
gsDPSetTextureLUT (G_TT_NONE),
gsDPSetTextureFilter (G_TF_BILERP),
gsDPSetTextureConvert(G_TC_FILT),
gsDPLoadTextureBlock (mahogany, G_IM_FMT_IA, G_IM_SIZ_16b, 32, 32, 0,
G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR,
5, 5, 3, 4),
gsSPDisplayList(sphere17),
gsSPEndDisplayList(),
};
/*
* Bump-mapped cratered planet
*/
#include "obj_dls.h"
Gfx craterplanet_dl[] = {
gsDPPipeSync(),
gsDPPipeSync(),
gsSPClearGeometryMode(0xffffffff),
gsSPSetGeometryMode(G_ZBUFFER | G_CULL_BACK | G_SHADE | G_SHADING_SMOOTH),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
/*
* The texture scaling parameters are .16 format. In order to
* get an exact texture scale of 1.0, we scale above by 2.0, and
* scale down here by 0.5
*/
gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
gsDPSetCombineMode(G_CC_MODULATERGBDECALA, G_CC_MODULATERGBDECALA),
gsDPSetTextureLOD(G_TL_TILE),
gsDPPipeSync(),
gsDPLoadTLUT_pal256( obj0_tlut ),
gsDPPipeSync(),
gsDPSetTextureLUT( G_TT_RGBA16 ),
gsDPSetTextureFilter(G_TF_BILERP),
gsSPDisplayList( obj0_dl ),
gsDPSetTextureLUT( G_TT_NONE ),
gsSPTexture(0, 0, 0, 0, G_OFF), /* done; turn texture off */
gsSPEndDisplayList(),
};
#ifdef MVTVIEW
/*
* MVT Object definitions
*/
#include "mvtview_dl.h"
#include "enterprise_mvt_dl.h"
#endif