]> git.tdb.fi Git - libs/gl.git/blob - shaderlib/msp_interface.glsl
959f9ba55b31742662bbd088c4a11c80df5165fd
[libs/gl.git] / shaderlib / msp_interface.glsl
1 struct LightSourceParameters
2 {
3         vec4 position;
4         vec3 color;
5 };
6
7 struct ClipPlane
8 {
9         vec4 equation;
10 };
11
12 uniform mat4 world_obj_matrix;
13 uniform mat3 world_obj_normal_matrix;
14 uniform CameraTransform
15 {
16         mat4 eye_world_matrix;
17         mat4 world_eye_matrix;
18         mat4 clip_eye_matrix;
19         mat4 eye_clip_matrix;
20 };
21
22 uniform Lighting
23 {
24         // Declared as an array for compatibility reasons
25         LightSourceParameters light_sources[1];
26         vec4 ambient_color;
27         vec4 sky_color;
28         vec3 world_zenith_dir;
29         float horizon_limit;
30         vec4 fog_color;
31         float fog_density;
32 };
33
34 layout(constant_id=auto) const bool use_clipping = false;
35 layout(constant_id=auto) const int max_clip_planes = 8;
36 uniform Clipping
37 {
38         ClipPlane clip_planes[max_clip_planes];
39 };
40
41 #pragma MSP stage(vertex)
42 layout(location=0) in vec4 vertex;
43 layout(location=1) in vec4 color;
44 layout(location=2) in vec3 normal;
45 layout(location=3) in vec3 tangent;
46 layout(location=4) in vec4 group;
47 layout(location=5) in vec4 weight;
48 layout(location=6) in vec4 texcoord;
49 layout(location=7) in vec4 texcoord1;
50 layout(location=8) in vec4 texcoord2;
51 layout(location=9) in vec4 texcoord3;
52 layout(location=13) in vec4 instance_transform[3];
53
54 #pragma MSP stage(fragment)
55 layout(location=0) out vec4 frag_color;