]> git.tdb.fi Git - libs/gl.git/blobdiff - shaderlib/msp_interface.glsl
Refactor the builtin occluder shader
[libs/gl.git] / shaderlib / msp_interface.glsl
index 959f9ba55b31742662bbd088c4a11c80df5165fd..3fdd606b1b51f70585fc9fd619133b13e63a46b3 100644 (file)
@@ -2,6 +2,8 @@ struct LightSourceParameters
 {
        vec4 position;
        vec3 color;
+       int type;
+       vec3 attenuation;
 };
 
 struct ClipPlane
@@ -19,14 +21,11 @@ uniform CameraTransform
        mat4 eye_clip_matrix;
 };
 
+layout(constant_id=auto) const int max_lights = 4;
 uniform Lighting
 {
-       // Declared as an array for compatibility reasons
-       LightSourceParameters light_sources[1];
+       LightSourceParameters light_sources[max_lights];
        vec4 ambient_color;
-       vec4 sky_color;
-       vec3 world_zenith_dir;
-       float horizon_limit;
        vec4 fog_color;
        float fog_density;
 };
@@ -43,13 +42,10 @@ layout(location=0) in vec4 vertex;
 layout(location=1) in vec4 color;
 layout(location=2) in vec3 normal;
 layout(location=3) in vec3 tangent;
-layout(location=4) in vec4 group;
+layout(location=4) in ivec4 group;
 layout(location=5) in vec4 weight;
 layout(location=6) in vec4 texcoord;
 layout(location=7) in vec4 texcoord1;
 layout(location=8) in vec4 texcoord2;
 layout(location=9) in vec4 texcoord3;
 layout(location=13) in vec4 instance_transform[3];
-
-#pragma MSP stage(fragment)
-layout(location=0) out vec4 frag_color;