From 8e4781b3103f68965b2aba4e914f7c3281ccbc59 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 23 Aug 2023 03:51:59 +0200 Subject: ok so shadows aren't very slow anymore --- shaders/lightmap.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'shaders/lightmap.cpp') diff --git a/shaders/lightmap.cpp b/shaders/lightmap.cpp index 186be81a..2f61e846 100644 --- a/shaders/lightmap.cpp +++ b/shaders/lightmap.cpp @@ -23,6 +23,7 @@ namespace floormat { namespace { +// todo add back drawing an 8x8 grid constexpr auto chunk_size = TILE_SIZE2 * TILE_MAX_DIM; constexpr auto chunk_offset = TILE_SIZE2/2; constexpr auto image_size = iTILE_SIZE2 * TILE_MAX_DIM; @@ -265,13 +266,15 @@ void lightmap_shader::add_light(const light_s& light) setUniform(ModeUniform, DrawLightmapMode); AbstractShaderProgram::draw(blend_mesh); -#if 0 +#if 1 + setUniform(ModeUniform, DrawShadowsMode); setUniform(LightColorUniform, Color3{0, 0, 0}); + setUniform(IntensityUniform, 1 ); fm_assert(occlusion_mesh.id()); auto mesh_view = GL::MeshView{occlusion_mesh}; mesh_view.setCount((int32_t)count*6); - AbstractShaderProgram::draw(mesh_view); mesh_view.setIndexRange(0, 0, uint32_t(count*6 - 1)); + AbstractShaderProgram::draw(mesh_view); #endif #if 0 -- cgit v1.2.3