]> git.tdb.fi Git - libs/gl.git/blob - shaderlib/msp_interface.glsl
Require import module names to be identifiers
[libs/gl.git] / shaderlib / msp_interface.glsl
1 struct LightSourceParameters
2 {
3         vec4 position;
4         vec4 diffuse;
5         vec4 specular;
6 };
7
8 struct MaterialParameters
9 {
10         vec4 ambient;
11         vec4 diffuse;
12         vec4 specular;
13         float shininess;
14 };
15
16 struct ClipPlane
17 {
18         vec4 equation;
19 };
20
21 uniform mat4 eye_obj_matrix;
22 uniform mat3 eye_obj_normal_matrix;
23 uniform Transform
24 {
25         mat4 eye_world_matrix;
26         mat4 projection_matrix;
27 };
28
29 uniform Material
30 {
31         MaterialParameters material;
32         float reflectivity;
33 };
34
35 uniform Lighting
36 {
37         // Declared as an array for compatibility reasons
38         LightSourceParameters light_sources[1];
39         vec4 ambient_color;
40         vec4 sky_color;
41         vec3 eye_zenith_dir;
42         float horizon_limit;
43         vec4 fog_color;
44         float fog_density;
45 };
46
47 uniform sampler2D diffuse_map;
48 uniform sampler2D normal_map;
49
50 uniform sampler2DShadow shadow;
51 uniform ShadowMap
52 {
53         float shadow_darkness;
54         mat4 shd_eye_matrix;
55 };
56
57 uniform samplerCube environment;
58 uniform EnvMap
59 {
60         mat3 env_eye_matrix;
61 };
62
63 const int max_clip_planes = 0;
64 uniform Clipping
65 {
66         ClipPlane clip_planes[max_clip_planes];
67 };
68
69 #pragma MSP stage(vertex)
70 layout(location=0) in vec4 vertex;
71 layout(location=8) in vec4 texcoord;
72 layout(location=3) in vec4 color;
73 layout(location=2) in vec3 normal;
74 layout(location=4) in vec3 tangent;
75 layout(location=5) in vec3 binormal;
76 layout(location=12) in vec4 instance_transform[3];
77
78 #pragma MSP stage(fragment)
79 layout(location=0) out vec4 frag_color;