]> git.tdb.fi Git - libs/gl.git/blob - shaderlib/msp_interface.glsl
Avoid removing outputs which are referenced but not assigned
[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 PbrMaterialParameters
18 {
19         vec4 base_color;
20         vec4 emission;
21         float metalness;
22         float roughness;
23 };
24
25 struct ClipPlane
26 {
27         vec4 equation;
28 };
29
30 uniform mat4 eye_obj_matrix;
31 uniform mat3 eye_obj_normal_matrix;
32 uniform Transform
33 {
34         mat4 eye_world_matrix;
35         mat4 projection_matrix;
36 };
37
38 uniform BasicMaterial
39 {
40         BasicMaterialParameters basic_material;
41 };
42
43 uniform PbrMaterial
44 {
45         PbrMaterialParameters pbr_material;
46 };
47
48 uniform Lighting
49 {
50         // Declared as an array for compatibility reasons
51         LightSourceParameters light_sources[1];
52         vec4 ambient_color;
53         vec4 sky_color;
54         vec3 eye_zenith_dir;
55         float horizon_limit;
56         vec4 fog_color;
57         float fog_density;
58 };
59
60 uniform sampler2D diffuse_map;
61 uniform sampler2D specular_map;
62 uniform sampler2D shininess_map;
63 uniform sampler2D base_color_map;
64 uniform sampler2D metalness_map;
65 uniform sampler2D roughness_map;
66 uniform sampler2D occlusion_map;
67 uniform sampler2D emission_map;
68 uniform sampler2D normal_map;
69
70 uniform sampler2DShadow shadow_map;
71 uniform ShadowMap
72 {
73         float shadow_darkness;
74         mat4 shd_eye_matrix;
75 };
76
77 uniform samplerCube environment_map;
78 uniform EnvMap
79 {
80         mat3 env_eye_matrix;
81 };
82
83 const int max_clip_planes = 0;
84 uniform Clipping
85 {
86         ClipPlane clip_planes[max_clip_planes];
87 };
88
89 #pragma MSP stage(vertex)
90 layout(location=0) in vec4 vertex;
91 layout(location=8) in vec4 texcoord;
92 layout(location=3) in vec4 color;
93 layout(location=2) in vec3 normal;
94 layout(location=4) in vec3 tangent;
95 layout(location=5) in vec3 binormal;
96 layout(location=12) in vec4 instance_transform[3];
97
98 #pragma MSP stage(fragment)
99 layout(location=0) out vec4 frag_color;