summaryrefslogtreecommitdiffhomepage
path: root/shaders
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-08-24 14:23:47 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-08-24 14:23:47 +0200
commit2afd695adcc777f43b2d49fc48e0005fbda11550 (patch)
tree417acc22eb81fd16277a26961604746fd15b71d7 /shaders
parent8f2c3df390c1b988ba50090333b03ab74d565ad6 (diff)
crap
Diffstat (limited to 'shaders')
-rw-r--r--shaders/lightmap.cpp8
1 files 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);