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 |
|
|
static varying_3f position_3f; |
11 |
|
|
static varying_4f position_4f; |
12 |
|
|
static varying_3f normal_3f; |
13 |
|
|
static varying_3f color_3f; |
14 |
|
|
static varying_4f color_4f; |
15 |
|
|
static varying_3f color2_3f; |
16 |
|
|
static varying_4f color2_4f; |
17 |
|
|
static varying_1f psize_1f; |
18 |
|
|
static varying_1f texcoord_1f[8]; |
19 |
|
|
static varying_2f texcoord_2f[8]; |
20 |
|
|
static varying_3f texcoord_3f[8]; |
21 |
|
|
static varying_4f texcoord_4f[8]; |
22 |
|
|
|
23 |
|
|
static glvar position; |
24 |
|
|
static glvar normal; |
25 |
|
|
} vin; |
26 |
|
|
|
27 |
|
|
extern struct vout |
28 |
|
|
{ |
29 |
|
|
// glstate builtin |
30 |
|
|
static glvar position; |
31 |
|
|
static glvar point_size; |
32 |
|
|
static glvar clip_vertex; |
33 |
|
|
|
34 |
|
|
// standard varying |
35 |
|
|
static glvar front_color; |
36 |
|
|
static glvar back_color; |
37 |
|
|
static glvar front_secondary_color; |
38 |
|
|
static glvar back_secondary_color; |
39 |
|
|
static glvar texcoord[8]; |
40 |
|
|
static glvar fog_frag_coord; |
41 |
|
|
} vout; |
42 |
|
|
|
43 |
|
|
extern struct fin |
44 |
|
|
{ |
45 |
|
|
// glstate builtin |
46 |
|
|
static glvar frag_coord; |
47 |
|
|
|
48 |
|
|
// standard varying |
49 |
|
|
static glvar color; |
50 |
|
|
static glvar secondary_color; |
51 |
|
|
static glvar texcoord[8]; |
52 |
|
|
static glvar fog_frag_coord; |
53 |
|
|
} fin; |
54 |
|
|
|
55 |
|
|
extern struct fout |
56 |
|
|
{ |
57 |
|
|
// glstate builtin |
58 |
|
|
static glvar frag_color; |
59 |
|
|
static glvar frag_depth; |
60 |
|
|
static glvar frag_data[2]; |
61 |
|
|
} fout; |
62 |
|
|
|
63 |
|
|
// predefined globals |
64 |
|
|
extern struct gl { |
65 |
|
|
static uniform_matrix_4f model_view_matrix, |
66 |
|
|
projection_matrix, |
67 |
|
|
model_view_projection_matrix, |
68 |
|
|
texture_matrix[8]; |
69 |
|
|
static uniform_matrix_4f model_view_matrix_inverse, |
70 |
|
|
projection_matrix_inverse, |
71 |
|
|
model_view_projection_matrix_inverse, |
72 |
|
|
texture_matrix_inverse[8]; |
73 |
|
|
static uniform_matrix_4f model_view_matrix_transpose, |
74 |
|
|
projection_matrix_transpose, |
75 |
|
|
model_view_projection_matrix_transpose, |
76 |
|
|
texture_matrix_transpose[8]; |
77 |
|
|
static uniform_matrix_4f model_view_matrix_inverse_transpose, |
78 |
|
|
projection_matrix_inverse_transpose, |
79 |
|
|
model_view_projection_matrix_inverse_transpose, |
80 |
|
|
texture_matrix_inverse_transpose[8]; |
81 |
|
|
|
82 |
|
|
static uniform_matrix_3f normal_matrix; |
83 |
|
|
|
84 |
|
|
static uniform_1f normal_scale; |
85 |
|
|
static uniform_1f depth_range_near, depth_range_far, depth_range_diff; |
86 |
|
|
|
87 |
|
|
static uniform_4f clip_plane[2];//TODO |
88 |
|
|
|
89 |
|
|
// point parameters TODO |
90 |
|
|
|
91 |
|
|
static uniform_4f front_material_emission, |
92 |
|
|
front_material_ambient, |
93 |
|
|
front_material_diffuse, |
94 |
|
|
front_material_specular, |
95 |
|
|
front_material_shininess; |
96 |
|
|
static uniform_4f back_material_emission, |
97 |
|
|
back_material_ambient, |
98 |
|
|
back_material_diffuse, |
99 |
|
|
back_material_specular, |
100 |
|
|
back_material_shininess; |
101 |
|
|
|
102 |
|
|
// light source parameters TODO |
103 |
|
|
|
104 |
|
|
static uniform_4f light_model_ambient; |
105 |
|
|
static uniform_4f front_light_model_product_scene_color; |
106 |
|
|
static uniform_4f back_light_model_product_scene_color; |
107 |
|
|
|
108 |
|
|
// light products TODO |
109 |
|
|
// texture env and gen TODO |
110 |
|
|
// fogparameters TODO |
111 |
|
|
|
112 |
|
|
// shader output are in vout and fout |
113 |
|
|
} gl; |
114 |
|
|
|
115 |
|
|
} |
116 |
|
|
|
117 |
|
|
#endif |
118 |
|
|
|
119 |
|
|
|