]> git.tdb.fi Git - libs/gl.git/blob - shaderlib/msp_interface.glsl
Naming tweaks in builtin shaders
[libs/gl.git] / shaderlib / msp_interface.glsl
1 struct LightSourceParameters
2 {
3         vec4 position;
4         vec4 diffuse;
5         vec4 specular;
6 };
7
8 struct BasicMaterialParameters
9 {
10         vec4 diffuse;
11         vec4 specular;
12         vec4 emission;
13         float shininess;
14         float reflectivity;
15 };
16
17 struct ClipPlane
18 {
19         vec4 equation;
20 };
21
22 uniform mat4 eye_obj_matrix;
23 uniform mat3 eye_obj_normal_matrix;
24 uniform Transform
25 {
26         mat4 eye_world_matrix;
27         mat4 projection_matrix;
28 };
29
30 uniform BasicMaterial
31 {
32         BasicMaterialParameters basic_material;
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 specular_map;
49 uniform sampler2D shininess_map;
50 uniform sampler2D emission_map;
51 uniform sampler2D normal_map;
52
53 uniform sampler2DShadow shadow_map;
54 uniform ShadowMap
55 {
56         float shadow_darkness;
57         mat4 shd_eye_matrix;
58 };
59
60 uniform samplerCube environment_map;
61 uniform EnvMap
62 {
63         mat3 env_eye_matrix;
64 };
65
66 const int max_clip_planes = 0;
67 uniform Clipping
68 {
69         ClipPlane clip_planes[max_clip_planes];
70 };
71
72 #pragma MSP stage(vertex)
73 layout(location=0) in vec4 vertex;
74 layout(location=8) in vec4 texcoord;
75 layout(location=3) in vec4 color;
76 layout(location=2) in vec3 normal;
77 layout(location=4) in vec3 tangent;
78 layout(location=5) in vec3 binormal;
79 layout(location=12) in vec4 instance_transform[3];
80
81 #pragma MSP stage(fragment)
82 layout(location=0) out vec4 frag_color;