diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-06-10 19:17:21 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-06-10 19:17:21 +0200 |
| commit | aa5089b36453026ad33ce3cc3c11210774a45c84 (patch) | |
| tree | fd54a9c53ea957d5dd34c746de1c7e09afae73a3 /shaders/lightmap.cpp | |
| parent | a0152f2c253dbf3c2c23d83a261d89e97310b430 (diff) | |
wip
Diffstat (limited to 'shaders/lightmap.cpp')
| -rw-r--r-- | shaders/lightmap.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/shaders/lightmap.cpp b/shaders/lightmap.cpp index 7fa76d69..bc61a434 100644 --- a/shaders/lightmap.cpp +++ b/shaders/lightmap.cpp @@ -116,12 +116,15 @@ void lightmap_shader::add_light(Vector2i neighbor_offset, const light_s& light) I = 1; break; case light_falloff::linear: - I = std::fmax(1.f, light.dist * tile_size); + I = light.dist * tile_size / 5; break; case light_falloff::quadratic: - I = std::fmax(1.f, light.dist * tile_size * 100); + I = light.dist * tile_size * 100; break; } + + I = std::fmax(1.f, I); + auto I_clip = I * tile_size; auto center = light.center + chunk_offset + Vector2(neighbor_offset)*chunk_size; auto center_clip = Vector2{center} * scale; // clip coordinate |
