diff --git a/assets/voxygen/shaders/include/light.glsl b/assets/voxygen/shaders/include/light.glsl index a6ac745fc2..2567109c10 100644 --- a/assets/voxygen/shaders/include/light.glsl +++ b/assets/voxygen/shaders/include/light.glsl @@ -9,7 +9,8 @@ struct Light { layout (std140, set = 0, binding = 3) uniform u_lights { - Light lights[31]; + // TODO: insert light max count constant here when loading the shaders + Light lights[20]; }; struct Shadow { diff --git a/assets/voxygen/shaders/include/lod.glsl b/assets/voxygen/shaders/include/lod.glsl index c710ab3899..a14170a536 100644 --- a/assets/voxygen/shaders/include/lod.glsl +++ b/assets/voxygen/shaders/include/lod.glsl @@ -136,7 +136,8 @@ float alt_at_real(vec2 pos) { // #if (FLUID_MODE == FLUID_MODE_CHEAP) // return alt_at(pos); // #elif (FLUID_MODE == FLUID_MODE_SHINY) - return (/*round*/(utextureBicubic(t_alt, s_alt, pos_to_tex(pos)).r * (/*1300.0*//*1278.7266845703125*/view_distance.w)) + /*140.0*/view_distance.z - focus_off.z); + const float U16_MAX = 65535.0; + return (/*round*/(utextureBicubic(t_alt, s_alt, pos_to_tex(pos)).r / U16_MAX * (/*1300.0*//*1278.7266845703125*/view_distance.w)) + /*140.0*/view_distance.z - focus_off.z); // #endif //+ (texture(t_noise, pos * 0.002).x - 0.5) * 64.0; diff --git a/assets/voxygen/shaders/include/shadows.glsl b/assets/voxygen/shaders/include/shadows.glsl index a95110d5c3..517a45db53 100644 --- a/assets/voxygen/shaders/include/shadows.glsl +++ b/assets/voxygen/shaders/include/shadows.glsl @@ -11,7 +11,7 @@ struct ShadowLocals { layout (std140, set = 0, binding = 9) uniform u_light_shadows { - ShadowLocals shadowMats[/*MAX_LAYER_FACES*/192]; + ShadowLocals shadowMats[/*MAX_LAYER_FACES*//*192*/126]; }; // Use with sampler2DShadow diff --git a/voxygen/src/render/pipelines/mod.rs b/voxygen/src/render/pipelines/mod.rs index d601fd64c0..4f6d2bf7eb 100644 --- a/voxygen/src/render/pipelines/mod.rs +++ b/voxygen/src/render/pipelines/mod.rs @@ -220,6 +220,7 @@ impl Default for Shadow { // Global scene data spread across several arrays. pub struct GlobalModel { + // TODO: enforce that these are the lengths in the shaders?? pub globals: Consts, pub lights: Consts, pub shadows: Consts, diff --git a/voxygen/src/scene/particle.rs b/voxygen/src/scene/particle.rs index 4fceee67fb..3e5f2a87da 100644 --- a/voxygen/src/scene/particle.rs +++ b/voxygen/src/scene/particle.rs @@ -236,15 +236,18 @@ impl ParticleMgr { self.maintain_shockwave_particles(scene_data); self.maintain_aura_particles(scene_data); self.maintain_buff_particles(scene_data); + + self.upload_particles(renderer); } else { // remove all particle lifespans - self.particles.clear(); + if !self.particles.is_empty() { + self.particles.clear(); + self.upload_particles(renderer); + } // remove all timings self.scheduler.clear(); } - - self.upload_particles(renderer); } fn maintain_body_particles(&mut self, scene_data: &SceneData) { diff --git a/voxygen/src/scene/simple.rs b/voxygen/src/scene/simple.rs index aa75a5a3c1..5766f1467b 100644 --- a/voxygen/src/scene/simple.rs +++ b/voxygen/src/scene/simple.rs @@ -107,8 +107,8 @@ impl Scene { let data = GlobalModel { globals: renderer.create_consts(&[Globals::default()]), - lights: renderer.create_consts(&[Light::default(); 32]), - shadows: renderer.create_consts(&[Shadow::default(); 32]), + lights: renderer.create_consts(&[Light::default(); 20]), + shadows: renderer.create_consts(&[Shadow::default(); 24]), shadow_mats: renderer.create_consts(&[ShadowLocals::default(); 6]), }; let lod = LodData::dummy(renderer);