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