From 2afd695adcc777f43b2d49fc48e0005fbda11550 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 24 Aug 2023 14:23:47 +0200 Subject: crap --- shaders/lightmap.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shaders/lightmap.cpp b/shaders/lightmap.cpp index 839bd782..6de117b0 100644 --- a/shaders/lightmap.cpp +++ b/shaders/lightmap.cpp @@ -113,8 +113,11 @@ void lightmap_shader::end_occlusion() { if (!occlusion_mesh.id()) occlusion_mesh = make_occlusion_mesh(); - vertex_buf.setSubData(0, vertexes.prefix(count)); - index_buf.setSubData(0, indexes.prefix(count)); + if (count > 0) + { + vertex_buf.setSubData(0, vertexes.prefix(count)); + index_buf.setSubData(0, indexes.prefix(count)); + } } } @@ -249,7 +252,6 @@ void lightmap_shader::add_light(Vector2 neighbor_offset, const light_s& light) fm_assert(occlusion_mesh.id()); auto mesh_view = GL::MeshView{occlusion_mesh}; mesh_view.setCount((int32_t)count*6); - mesh_view.setIndexRange(0, 0, uint32_t(count*6 - 1)); AbstractShaderProgram::draw(mesh_view); setUniform(ModeUniform, BlendLightmapMode); -- cgit v1.2.3