ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/shader_vars.h
Revision: 1.2
Committed: Sun Oct 24 00:36:23 2004 UTC (19 years, 7 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.1: +18 -12 lines
Log Message:
*** empty log message ***

File Contents

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