-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskybox.h
146 lines (114 loc) · 12.2 KB
/
skybox.h
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
//
// Created by Tim on 9/7/2020.
//
#include <ultra64.h>
static Gfx space_tile_C_dummy_aligner1[] = { gsSPEndDisplayList() };
unsigned short space_texture[] = {
0x1005, 0x1847, 0x1849, 0x1849, 0x28CD, 0x288D, 0x208D, 0x184B, 0x208B, 0x1849, 0x204B, 0x204B, 0x2049, 0x2047, 0x284B, 0x304B, 0x3049, 0x2847, 0x1805, 0x1005, 0x1805, 0x1805, 0x1845, 0x1845, 0x1045, 0x1043, 0x0843, 0x0801, 0x01, 0x20C7, 0x0843, 0x0843,
0x1045, 0x284B, 0x284D, 0x1849, 0x1849, 0x1049, 0x1047, 0x1047, 0x1045, 0x1045, 0x1047, 0x4191, 0x204B, 0x284B, 0x4891, 0x58D1, 0x408D, 0x3049, 0x2047, 0x2047, 0x1805, 0x1805, 0x1847, 0x1845, 0x1845, 0x1045, 0x1003, 0x0803, 0x0843, 0x0845, 0x0845, 0x0845,
0x1849, 0x304D, 0x308F, 0x1849, 0x1047, 0x1047, 0x1847, 0x1005, 0x0843, 0x0803, 0x0805, 0x1849, 0x204D, 0x304F, 0x5897, 0x6895, 0x488F, 0x410D, 0x384B, 0x3049, 0x2047, 0x1845, 0x1005, 0x1845, 0x1045, 0x1847, 0x1845, 0x1045, 0x1087, 0x1047, 0x1045, 0x1047,
0x204B, 0x3893, 0x3091, 0x1849, 0x1047, 0x20C7, 0x1045, 0x1045, 0x0803, 0x01, 0x0803, 0x1045, 0x1849, 0x284F, 0x4895, 0x70D9, 0x5091, 0x488D, 0x404D, 0x3049, 0x2847, 0x310B, 0x1005, 0x1847, 0x2049, 0x204B, 0x204B, 0x1849, 0x184B, 0x1849, 0x1047, 0x1847,
0x308F, 0x3893, 0x3093, 0x204B, 0x1047, 0x1045, 0x1887, 0x1045, 0x0803, 0x01, 0x01, 0x0843, 0x318D, 0x204D, 0x3893, 0x5895, 0x6093, 0x408D, 0x384B, 0x3049, 0x2047, 0x30C7, 0x1847, 0x2049, 0x284B, 0x284D, 0x208B, 0x204D, 0x288F, 0x288D, 0x1849, 0x2049,
0x308D, 0x3891, 0x288F, 0x184B, 0x1849, 0x1847, 0x1045, 0x1045, 0x0803, 0x0801, 0x0801, 0x0843, 0x0845, 0x1047, 0x2049, 0x304D, 0x408F, 0x308B, 0x2049, 0x2047, 0x1845, 0x1005, 0x1845, 0x20C9, 0x204B, 0x204B, 0x204B, 0x314F, 0x288F, 0x388F, 0x304B, 0x2849,
0x284B, 0x284D, 0x310F, 0x184B, 0x204B, 0x1847, 0x1845, 0x1005, 0x0803, 0x0803, 0x0803, 0x0843, 0x1083, 0x0843, 0x1045, 0x2047, 0x2849, 0x1847, 0x1045, 0x1045, 0x1847, 0x1045, 0x1847, 0x2049, 0x2049, 0x1849, 0x1849, 0x184B, 0x284D, 0x388D, 0x3049, 0x2849,
0x2047, 0x1847, 0x1849, 0x1849, 0x2049, 0x2049, 0x1845, 0x1805, 0x1805, 0x2043, 0x2085, 0x0843, 0x0843, 0x0803, 0x1003, 0x1003, 0x1045, 0x1045, 0x0845, 0x1045, 0x1047, 0x2089, 0x1847, 0x2049, 0x30CD, 0x204B, 0x2049, 0x204B, 0x2049, 0x2849, 0x2047, 0x3089,
0x2047, 0x1847, 0x39D1, 0x2049, 0x284B, 0x288B, 0x2047, 0x2047, 0x2805, 0x3045, 0x2805, 0x1805, 0x0803, 0x0843, 0x1043, 0x1003, 0x1003, 0x0843, 0x0803, 0x0845, 0x1047, 0x1047, 0x1045, 0x1847, 0x204B, 0x30CF, 0x308D, 0x288B, 0x2049, 0x2047, 0x2005, 0x30C7,
0x1805, 0x1805, 0x2049, 0x288D, 0x388F, 0x284D, 0x2047, 0x2847, 0x2847, 0x3847, 0x4047, 0x2845, 0x1005, 0x1043, 0x18C5, 0x1003, 0x1845, 0x1043, 0x0843, 0x0845, 0x1045, 0x0845, 0x1045, 0x1045, 0x2049, 0x38CF, 0x388D, 0x3049, 0x2047, 0x2045, 0x1805, 0x1805,
0x1805, 0x1805, 0x1847, 0x2049, 0x284D, 0x288B, 0x2849, 0x3089, 0x2847, 0x3849, 0x4047, 0x3047, 0x2047, 0x1045, 0x1045, 0x1845, 0x1845, 0x1045, 0x0843, 0x0845, 0x0845, 0x0843, 0x0845, 0x0845, 0x1045, 0x2049, 0x3049, 0x2847, 0x2005, 0x2005, 0x1803, 0x1003,
0x1845, 0x1005, 0x1005, 0x1045, 0x1847, 0x2049, 0x2047, 0x2047, 0x2047, 0x2847, 0x3047, 0x2847, 0x2047, 0x1847, 0x2087, 0x1847, 0x1847, 0x1847, 0x1045, 0x0843, 0x0843, 0x0803, 0x0803, 0x0803, 0x0843, 0x1005, 0x2045, 0x2045, 0x1803, 0x2045, 0x1803, 0x1805,
0x1005, 0x1005, 0x1005, 0x1045, 0x0845, 0x1045, 0x1045, 0x1045, 0x1845, 0x38CB, 0x3049, 0x2849, 0x2049, 0x1849, 0x2049, 0x1849, 0x1847, 0x1847, 0x1045, 0x0843, 0x0803, 0x03, 0x03, 0x01, 0x0843, 0x0803, 0x1001, 0x1003, 0x1003, 0x1803, 0x1803, 0x1805,
0x1003, 0x1003, 0x0803, 0x0843, 0x0843, 0x0803, 0x0803, 0x1043, 0x1845, 0x2049, 0x3089, 0x2049, 0x1849, 0x28CD, 0x1849, 0x1847, 0x1847, 0x1845, 0x1045, 0x0803, 0x01, 0x01, 0x01, 0x0843, 0x01, 0x01, 0x0801, 0x0801, 0x1003, 0x1883, 0x1003, 0x1003,
0x0803, 0x1043, 0x0803, 0x0803, 0x0803, 0x0803, 0x0803, 0x0803, 0x1045, 0x1005, 0x1807, 0x1847, 0x1047, 0x28CB, 0x1007, 0x1045, 0x1887, 0x1045, 0x1043, 0x0801, 0x0881, 0x01, 0x01, 0x0841, 0x20C7, 0x0843, 0x01, 0x0801, 0x0803, 0x1003, 0x1003, 0x1003,
0x0843, 0x0803, 0x0803, 0x0803, 0x0803, 0x0805, 0x0803, 0x0803, 0x0805, 0x0805, 0x1005, 0x0805, 0x0805, 0x0803, 0x0803, 0x0803, 0x1043, 0x1043, 0x1003, 0x0801, 0x01, 0x1907, 0x01, 0x01, 0x0841, 0x01, 0x01, 0x01, 0x0803, 0x0803, 0x0801, 0x0803,
0x0843, 0x0803, 0x0803, 0x1003, 0x1005, 0x1045, 0x0803, 0x0803, 0x0803, 0x0803, 0x0803, 0x18C5, 0x01, 0x03, 0x0803, 0x0803, 0x0803, 0x1883, 0x1043, 0x0801, 0x01, 0x01, 0x0843, 0x01, 0x03, 0x01, 0x03, 0x03, 0x0803, 0x0803, 0x0803, 0x0803,
0x0803, 0x0803, 0x0803, 0x0803, 0x1005, 0x1005, 0x1045, 0x0803, 0x0803, 0x0803, 0x01, 0x01, 0x01, 0x01, 0x0801, 0x0803, 0x0803, 0x1003, 0x0803, 0x0803, 0x0801, 0x0801, 0x0803, 0x01, 0x0803, 0x0803, 0x0843, 0x0843, 0x0803, 0x0803, 0x0803, 0x0803,
0x18C5, 0x0803, 0x0801, 0x0803, 0x1003, 0x1805, 0x1805, 0x1085, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0801, 0x0801, 0x0843, 0x1043, 0x1043, 0x1843, 0x1845, 0x1043, 0x0843, 0x1003, 0x0843, 0x0843, 0x0843, 0x0843, 0x0845, 0x18C7, 0x1045, 0x0845, 0x20C5,
0x0803, 0x1003, 0x0803, 0x0801, 0x1003, 0x1805, 0x2045, 0x1805, 0x0803, 0x0841, 0x01, 0x01, 0x0843, 0x1043, 0x1003, 0x1043, 0x1043, 0x1845, 0x1845, 0x1845, 0x1005, 0x1003, 0x1805, 0x1045, 0x1045, 0x1045, 0x1045, 0x1047, 0x1087, 0x0845, 0x0843, 0x1043,
0x1043, 0x0803, 0x0803, 0x0803, 0x1003, 0x1805, 0x2003, 0x1803, 0x1885, 0x0803, 0x0843, 0x0843, 0x1885, 0x1845, 0x1845, 0x1845, 0x1805, 0x1845, 0x1845, 0x1845, 0x1005, 0x1005, 0x1805, 0x1845, 0x1045, 0x2087, 0x2049, 0x1849, 0x1047, 0x1045, 0x0843, 0x0843,
0x0843, 0x1083, 0x0843, 0x0803, 0x1003, 0x2085, 0x1845, 0x2085, 0x1003, 0x1043, 0x1045, 0x20C7, 0x1847, 0x2049, 0x2047, 0x1805, 0x1805, 0x1805, 0x1805, 0x1805, 0x1805, 0x1005, 0x1005, 0x1045, 0x1847, 0x28C7, 0x2049, 0x204B, 0x1049, 0x1047, 0x0845, 0x0845,
0x0843, 0x0803, 0x0843, 0x0843, 0x1043, 0x1043, 0x1045, 0x1847, 0x1847, 0x1847, 0x1847, 0x2047, 0x1847, 0x1847, 0x1847, 0x1805, 0x1005, 0x1003, 0x1003, 0x1845, 0x1805, 0x1805, 0x1005, 0x1045, 0x1845, 0x1847, 0x2049, 0x204B, 0x204D, 0x1849, 0x1047, 0x0845,
0x0845, 0x0843, 0x0843, 0x0803, 0x1043, 0x1043, 0x1847, 0x2049, 0x284B, 0x204B, 0x2049, 0x2047, 0x2047, 0x1805, 0x1005, 0x1005, 0x1005, 0x1003, 0x1003, 0x1805, 0x2047, 0x1845, 0x1043, 0x0843, 0x1045, 0x1047, 0x204B, 0x208D, 0x288D, 0x284D, 0x204B, 0x1847,
0x1847, 0x1045, 0x0843, 0x0843, 0x1043, 0x1045, 0x1847, 0x30CD, 0x208D, 0x288D, 0x2049, 0x2047, 0x1805, 0x1005, 0x1003, 0x1003, 0x1003, 0x1003, 0x1003, 0x1805, 0x2047, 0x1845, 0x1043, 0x0843, 0x0843, 0x0845, 0x1849, 0x284D, 0x388F, 0x388F, 0x308D, 0x204B,
0x204B, 0x1047, 0x0845, 0x1085, 0x1045, 0x1847, 0x204B, 0x308D, 0x308F, 0x284D, 0x2849, 0x2847, 0x1805, 0x1003, 0x1003, 0x1003, 0x1003, 0x1803, 0x1805, 0x1805, 0x1845, 0x1005, 0x1909, 0x0843, 0x0843, 0x0843, 0x1047, 0x308D, 0x4891, 0x4891, 0x488F, 0x304D,
0x284B, 0x1847, 0x1045, 0x0845, 0x1045, 0x1849, 0x288D, 0x3891, 0x4893, 0x388F, 0x304B, 0x2847, 0x1805, 0x0803, 0x0803, 0x1003, 0x1845, 0x1805, 0x1805, 0x1847, 0x1045, 0x0843, 0x0843, 0x0843, 0x0843, 0x0843, 0x1047, 0x304D, 0x5891, 0x6095, 0x4891, 0x304D,
0x2049, 0x1847, 0x1047, 0x1045, 0x1045, 0x1849, 0x284D, 0x3891, 0x5153, 0x388F, 0x30CB, 0x2045, 0x1043, 0x0803, 0x0803, 0x1003, 0x1805, 0x1805, 0x1805, 0x1847, 0x1045, 0x1085, 0x0843, 0x01, 0x03, 0x0803, 0x1005, 0x284B, 0x484F, 0x5891, 0x404D, 0x304B,
0x1845, 0x1847, 0x1847, 0x1847, 0x1849, 0x208B, 0x208D, 0x3091, 0x4091, 0x304D, 0x2047, 0x1845, 0x1003, 0x0843, 0x0803, 0x1845, 0x1845, 0x1005, 0x1805, 0x1887, 0x1045, 0x0845, 0x0843, 0x01, 0x03, 0x03, 0x0803, 0x2087, 0x2849, 0x3849, 0x2847, 0x2005,
0x1845, 0x2047, 0x2049, 0x1849, 0x204B, 0x288F, 0x288F, 0x4113, 0x4093, 0x304B, 0x2087, 0x1845, 0x1003, 0x0803, 0x1003, 0x1805, 0x2047, 0x1805, 0x2889, 0x2047, 0x1849, 0x1045, 0x0803, 0x0843, 0x01, 0x0803, 0x0803, 0x0843, 0x1045, 0x1805, 0x1005, 0x1005,
0x1045, 0x1847, 0x1849, 0x204B, 0x288F, 0x3091, 0x288F, 0x30D1, 0x3891, 0x308D, 0x2049, 0x1845, 0x1003, 0x1003, 0x1885, 0x2847, 0x3049, 0x2847, 0x2849, 0x2849, 0x2049, 0x1847, 0x0803, 0x0803, 0x0803, 0x0843, 0x0843, 0x0803, 0x0843, 0x0803, 0x0803, 0x0803,
0x1045, 0x1045, 0x1847, 0x204B, 0x288F, 0x2891, 0x2891, 0x310F, 0x288F, 0x288D, 0x288B, 0x2047, 0x1845, 0x1845, 0x2047, 0x3049, 0x3849, 0x2847, 0x2007, 0x2049, 0x1847, 0x1847, 0x1805, 0x1045, 0x1043, 0x0843, 0x2907, 0x0803, 0x0803, 0x0843, 0x0843, 0x0843,
};
Vtx skybox_vertices[] ={
{2999, 2999, -2999,0, 0 << 6, 128 << 6,0x0, 0x7F, 0x0, 0xFF},
{-2999, 2999, -2999,0, 128 << 6, 128 << 6,0x0, 0x7F, 0x0, 0xFF}, //
{-2999, 2999, 2999,0, 128 << 6, 0 << 6,0x0, 0x7F, 0x0, 0xFF}, //
{2999, 2999, 2999,0, 0 << 6, 0 << 6,0x0, 0x7F, 0x0, 0xFF}, //
{2999, -2999, 2999,0, 0 << 6, 0 << 6,0x0, 0x0, 0x7F, 0xFF},
{2999, 2999, 2999,0, 0 << 6, 128 << 6,0x0, 0x0, 0x7F, 0xFF},
{-2999, 2999, 2999,0, 128 << 6, 128 << 6,0x0, 0x0, 0x7F, 0xFF},
{-2999, -2999, 2999,0, 128 << 6, 0 << 6,0x0, 0x0, 0x7F, 0xFF},
{-2999, -2999, 2999,0, 128 << 6, 128 << 6,0x81, 0x0, 0x0, 0xFF},
{-2999, 2999, 2999,0, 128 << 6, 0 << 6,0x81, 0x0, 0x0, 0xFF},
{-2999, 2999, -2999,0, 0 << 6, 0 << 6,0x81, 0x0, 0x0, 0xFF},
{-2999, -2999, -2999,0, 0 << 6, 128 << 6,0x81, 0x0, 0x0, 0xFF},
{-2999, -2999, -2999,0, 0 << 6, 128 << 6,0x0, 0x81, 0x0, 0xFF},
{2999, -2999, -2999,0, 128 << 6, 128 << 6,0x0, 0x81, 0x0, 0xFF},
{2999, -2999, 2999,0, 128 << 6, 0 << 6,0x0, 0x81, 0x0, 0xFF},
{-2999, -2999, 2999,0, 0 << 6, 0 << 6,0x0, 0x81, 0x0, 0xFF},
{2999, -2999, -2999,0, 0 << 6, 0 << 6,0x7F, 0x0, 0x0, 0xFF},
{2999, 2999, -2999,0, 0 << 6, 128 << 6,0x7F, 0x0, 0x0, 0xFF},
{2999, 2999, 2999,0, 128 << 6, 128 << 6,0x7F, 0x0, 0x0, 0xFF},
{2999, -2999, 2999,0, 128 << 6, 0 << 6,0x7F, 0x0, 0x0, 0xFF},
{-2999, -2999, -2999,0, 128 << 6, 128 << 6,0x0, 0x0, 0x81, 0xFF},
{-2999, 2999, -2999,0, 128 << 6, 0 << 6,0x0, 0x0, 0x81, 0xFF},
{2999, 2999, -2999,0, 0 << 6, 0 << 6,0x0, 0x0, 0x81, 0xFF},
{2999, -2999, -2999,0, 0 << 6, 128 << 6,0x0, 0x0, 0x81, 0xFF},
};
//0 1 2 0 2 3 ( Plane at -200z)
//
Gfx skybox_dl[] =
{
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
gsSPClearGeometryMode(0xFFFFFFFF),
gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH | G_ZBUFFER),
gsDPSetCombineLERP(0, 0, 0, TEXEL0,
0, 0, 0, TEXEL0,
0, 0, 0, TEXEL0,
0, 0, 0, TEXEL0),
gsDPLoadTextureBlock(space_texture,
G_IM_FMT_RGBA,
G_IM_SIZ_16b,
32, 32,
0,
G_TX_WRAP,
G_TX_WRAP,
5, 5,
G_TX_NOLOD, G_TX_NOLOD),
gsDPLoadSync(),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureFilter(G_TF_BILERP),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLUT(G_TT_NONE),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_AA_ZB_XLU_SURF, G_RM_AA_ZB_XLU_SURF2),
gsSPVertex(skybox_vertices + 0, 16, 0),
gsSP1Triangle( 0, 1, 2, 0),
gsSP1Triangle( 0, 2, 3, 0),
gsSP1Triangle( 4, 5, 6, 0),
gsSP1Triangle( 4, 6, 7, 0),
gsSP1Triangle(8, 9, 10, 0),
gsSP1Triangle(8, 10, 11, 0),
gsSP1Triangle(12, 13, 14, 0),
gsSP1Triangle(12, 14, 15, 0),
gsSPVertex( skybox_vertices + 16, 8, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsSP1Triangle(4, 5, 6, 0),
gsSP1Triangle(4, 6, 7, 0),
gsSPSetGeometryMode(G_ZBUFFER),
gsDPPipeSync(),
gsSPEndDisplayList(),
};