From: Mikko Rasa Date: Sun, 7 Nov 2021 12:38:49 +0000 (+0200) Subject: Change max_lights to a fixed constant X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4571472425ca75573895c96f590ba12dedbed661;p=libs%2Fgl.git Change max_lights to a fixed constant --- diff --git a/shaderlib/msp_interface.glsl b/shaderlib/msp_interface.glsl index 13cd9ccf..724538ff 100644 --- a/shaderlib/msp_interface.glsl +++ b/shaderlib/msp_interface.glsl @@ -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]; diff --git a/source/effects/shadowmap.cpp b/source/effects/shadowmap.cpp index ddb78aeb..9aee4907 100644 --- a/source/effects/shadowmap.cpp +++ b/source/effects/shadowmap.cpp @@ -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); diff --git a/source/materials/lighting.cpp b/source/materials/lighting.cpp index 6957126b..d8e54006 100644 --- a/source/materials/lighting.cpp +++ b/source/materials/lighting.cpp @@ -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));