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