]> git.tdb.fi Git - libs/gl.git/commitdiff
Change max_lights to a fixed constant
authorMikko Rasa <tdb@tdb.fi>
Sun, 7 Nov 2021 12:38:49 +0000 (14:38 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 7 Nov 2021 14:00:32 +0000 (16:00 +0200)
shaderlib/msp_interface.glsl
source/effects/shadowmap.cpp
source/materials/lighting.cpp

index 13cd9ccf9665a92d6603164639e1edc6099e6847..724538ffb95a84e6cbf69775b2c0e6f0664bc428 100644 (file)
@@ -16,7 +16,7 @@ uniform CameraTransform
        mat4 eye_clip_matrix;
 };
 
-layout(constant_id=auto) const int max_lights = 4;
+const int max_lights = 6;
 uniform Lighting
 {
        LightSourceParameters light_sources[max_lights];
index ddb78aeb6ff5a3c07aa59cb07548604089b48e8d..9aee4907a1cd5eb174bfd30d32f0bbd38c32f388 100644 (file)
@@ -24,7 +24,7 @@ ShadowMap::ShadowMap(unsigned w, unsigned h, Renderable &c, const Lighting *l):
        fbo.attach(DEPTH_ATTACHMENT, depth_buf, 0);
 
        set_darkness(1.0f);
-       for(unsigned i=0; i<4; ++i)
+       for(unsigned i=0; i<6; ++i)
        {
                string base = format("shadows[%d]", i);
                shdata.uniform(base+".type", 0);
index 6957126b6c3bfeef3ad37192c541454fecde2eef..d8e5400626ae43eb26221ebd92bd748bb8043972 100644 (file)
@@ -18,7 +18,7 @@ Lighting::Lighting()
        set_fog_color(Color(0.0f, 0.0f, 0.0f, 0.0f));
        set_fog_density(0.0f);
 
-       for(unsigned i=0; i<7; ++i)
+       for(unsigned i=0; i<6; ++i)
        {
                string base = format("light_sources[%d]", i);
                shdata.uniform(base+".position", Vector4(0, 0, 1, 0));