-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPaletteShader.h
73 lines (70 loc) · 2.41 KB
/
PaletteShader.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
/*
// http://stackoverflow.com/questions/13145084/fast-paletted-screen-blit-with-direct3d-9
// we pay 1 extra intruction to use a 256x256 texture instead of a 256x1 texture...
// ... perhaps we could just repeat the palette 256 times to save that 1 instruction...
// we should be using 16x16 but it seems costly to calc the row index?
//
// fxc /Tps_2_0 pal_shader.hlsl /FhPaletteShader.h
sampler s0 : register(s0);
sampler s1 : register(s1);
float4 main( float2 texCoord : TEXCOORD0 ) : COLOR0
{
return tex2D( s1, float2( tex2D( s0,texCoord ).r * (255./256) + (0.5/256), 0 ) );
}
*/
const BYTE g_ps20_main[] =
{
0, 2, 255, 255, 254, 255,
42, 0, 67, 84, 65, 66,
28, 0, 0, 0, 115, 0,
0, 0, 0, 2, 255, 255,
2, 0, 0, 0, 28, 0,
0, 0, 0, 1, 0, 0,
108, 0, 0, 0, 68, 0,
0, 0, 3, 0, 0, 0,
1, 0, 2, 0, 72, 0,
0, 0, 0, 0, 0, 0,
88, 0, 0, 0, 3, 0,
1, 0, 1, 0, 6, 0,
92, 0, 0, 0, 0, 0,
0, 0, 115, 48, 0, 171,
4, 0, 12, 0, 1, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 115, 49,
0, 171, 4, 0, 12, 0,
1, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0,
112, 115, 95, 50, 95, 48,
0, 77, 105, 99, 114, 111,
115, 111, 102, 116, 32, 40,
82, 41, 32, 72, 76, 83,
76, 32, 83, 104, 97, 100,
101, 114, 32, 67, 111, 109,
112, 105, 108, 101, 114, 32,
57, 46, 50, 57, 46, 57,
53, 50, 46, 51, 49, 49,
49, 0, 81, 0, 0, 5,
0, 0, 15, 160, 0, 0,
127, 63, 0, 0, 0, 59,
0, 0, 0, 0, 0, 0,
0, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0,
3, 176, 31, 0, 0, 2,
0, 0, 0, 144, 0, 8,
15, 160, 31, 0, 0, 2,
0, 0, 0, 144, 1, 8,
15, 160, 66, 0, 0, 3,
0, 0, 15, 128, 0, 0,
228, 176, 0, 8, 228, 160,
4, 0, 0, 4, 0, 0,
1, 128, 0, 0, 0, 128,
0, 0, 0, 160, 0, 0,
85, 160, 1, 0, 0, 2,
0, 0, 2, 128, 0, 0,
170, 160, 66, 0, 0, 3,
0, 0, 15, 128, 0, 0,
228, 128, 1, 8, 228, 160,
1, 0, 0, 2, 0, 8,
15, 128, 0, 0, 228, 128,
255, 255, 0, 0
};