]> git.tdb.fi Git - libs/gl.git/blobdiff - shaderlib/msp_interface.glsl
Split the Light class into subclasses by light type
[libs/gl.git] / shaderlib / msp_interface.glsl
index 959f9ba55b31742662bbd088c4a11c80df5165fd..d8de5d240b90f6c416cac9a7b7cc37a361debe1c 100644 (file)
@@ -2,6 +2,7 @@ struct LightSourceParameters
 {
        vec4 position;
        vec3 color;
+       int type;
 };
 
 struct ClipPlane
@@ -19,14 +20,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,7 +41,7 @@ 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;