1 |
root |
1.1 |
#ifndef SHADER_VARS_H |
2 |
|
|
#define SHADER_VARS_H |
3 |
|
|
|
4 |
|
|
#include "shader.h" |
5 |
|
|
|
6 |
|
|
namespace shader { |
7 |
|
|
|
8 |
|
|
extern struct vin |
9 |
|
|
{ |
10 |
root |
1.2 |
// for setting |
11 |
|
|
static varying_3f vertex_3f; |
12 |
|
|
static varying_4f vertex_4f; |
13 |
root |
1.1 |
static varying_3f normal_3f; |
14 |
|
|
static varying_3f color_3f; |
15 |
|
|
static varying_4f color_4f; |
16 |
root |
1.2 |
static varying_3f secondary_color_3f; |
17 |
|
|
static varying_4f secondary_color_4f; |
18 |
|
|
static varying_1f tex_coord_1f[8]; |
19 |
|
|
static varying_2f tex_coord_2f[8]; |
20 |
|
|
static varying_3f tex_coord_3f[8]; |
21 |
|
|
static varying_4f tex_coord_4f[8]; |
22 |
root |
1.1 |
|
23 |
root |
1.2 |
// for the vertex shader |
24 |
root |
1.3 |
static const glvar vertex; |
25 |
|
|
static const glvar normal; |
26 |
|
|
static const glvar color; |
27 |
|
|
static const glvar secondary_color; |
28 |
|
|
static const glvar tex_coord[8]; |
29 |
|
|
static const glvar fog_coord; |
30 |
root |
1.1 |
} vin; |
31 |
|
|
|
32 |
|
|
extern struct vout |
33 |
|
|
{ |
34 |
|
|
// glstate builtin |
35 |
root |
1.3 |
static const glvar position; |
36 |
|
|
static const glvar point_size; |
37 |
|
|
static const glvar clip_vertex; |
38 |
root |
1.1 |
|
39 |
|
|
// standard varying |
40 |
root |
1.3 |
static const glvar front_color; |
41 |
|
|
static const glvar back_color; |
42 |
|
|
static const glvar front_secondary_color; |
43 |
|
|
static const glvar back_secondary_color; |
44 |
|
|
static const glvar tex_coord[8]; |
45 |
|
|
static const glvar fog_frag_coord; |
46 |
root |
1.1 |
} vout; |
47 |
|
|
|
48 |
|
|
extern struct fin |
49 |
|
|
{ |
50 |
|
|
// glstate builtin |
51 |
root |
1.3 |
static const glvar frag_coord; |
52 |
|
|
static const glvar front_facing; |
53 |
root |
1.1 |
|
54 |
|
|
// standard varying |
55 |
root |
1.3 |
static const glvar color; |
56 |
|
|
static const glvar secondary_color; |
57 |
|
|
static const glvar tex_coord[8]; |
58 |
|
|
static const glvar fog_frag_coord; |
59 |
root |
1.1 |
} fin; |
60 |
|
|
|
61 |
|
|
extern struct fout |
62 |
|
|
{ |
63 |
|
|
// glstate builtin |
64 |
root |
1.3 |
static const glvar frag_color; |
65 |
|
|
static const glvar frag_depth; |
66 |
|
|
static const glvar frag_data[2]; |
67 |
root |
1.1 |
} fout; |
68 |
|
|
|
69 |
|
|
// predefined globals |
70 |
|
|
extern struct gl { |
71 |
root |
1.4 |
static glvar model_view_matrix, |
72 |
|
|
projection_matrix, |
73 |
|
|
model_view_projection_matrix, |
74 |
|
|
texture_matrix[8]; |
75 |
|
|
static glvar model_view_matrix_inverse, |
76 |
|
|
projection_matrix_inverse, |
77 |
|
|
model_view_projection_matrix_inverse, |
78 |
|
|
texture_matrix_inverse[8]; |
79 |
|
|
static glvar model_view_matrix_transpose, |
80 |
|
|
projection_matrix_transpose, |
81 |
|
|
model_view_projection_matrix_transpose, |
82 |
|
|
texture_matrix_transpose[8]; |
83 |
|
|
static glvar model_view_matrix_inverse_transpose, |
84 |
|
|
projection_matrix_inverse_transpose, |
85 |
|
|
model_view_projection_matrix_inverse_transpose, |
86 |
|
|
texture_matrix_inverse_transpose[8]; |
87 |
root |
1.1 |
|
88 |
root |
1.4 |
static glvar normal_matrix; |
89 |
root |
1.1 |
|
90 |
root |
1.4 |
static glvar normal_scale; |
91 |
|
|
static glvar depth_range_near, depth_range_far, depth_range_diff; |
92 |
root |
1.1 |
|
93 |
root |
1.4 |
static glvar clip_plane[2];//TODO |
94 |
root |
1.1 |
|
95 |
|
|
// point parameters TODO |
96 |
|
|
|
97 |
root |
1.4 |
static glvar front_material_emission, |
98 |
|
|
front_material_ambient, |
99 |
|
|
front_material_diffuse, |
100 |
|
|
front_material_specular, |
101 |
|
|
front_material_shininess; |
102 |
|
|
static glvar back_material_emission, |
103 |
|
|
back_material_ambient, |
104 |
|
|
back_material_diffuse, |
105 |
|
|
back_material_specular, |
106 |
|
|
back_material_shininess; |
107 |
root |
1.1 |
|
108 |
|
|
// light source parameters TODO |
109 |
|
|
|
110 |
root |
1.4 |
static glvar light_model_ambient; |
111 |
|
|
static glvar front_light_model_product_scene_color; |
112 |
|
|
static glvar back_light_model_product_scene_color; |
113 |
root |
1.1 |
|
114 |
|
|
// light products TODO |
115 |
|
|
// texture env and gen TODO |
116 |
|
|
// fogparameters TODO |
117 |
|
|
|
118 |
|
|
// shader output are in vout and fout |
119 |
|
|
} gl; |
120 |
|
|
|
121 |
|
|
} |
122 |
|
|
|
123 |
|
|
#endif |
124 |
|
|
|
125 |
|
|
|