diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-06-11 02:40:06 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-06-11 02:40:06 +0200 |
| commit | 04b9df316971e0cb897605fdabb16da712f3f791 (patch) | |
| tree | 3c54c390ec3f42fc8d66d6f3f9bb7b36b2feeb08 /shaders/lightmap.cpp | |
| parent | d63ae5ac3af050be4439b8d9f9d0c06f94058b7c (diff) | |
wip
Diffstat (limited to 'shaders/lightmap.cpp')
| -rw-r--r-- | shaders/lightmap.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/shaders/lightmap.cpp b/shaders/lightmap.cpp index bc61a434..7c955e1f 100644 --- a/shaders/lightmap.cpp +++ b/shaders/lightmap.cpp @@ -24,14 +24,14 @@ constexpr auto buffer_size = 256uz; } // namespace -auto lightmap_shader::make_framebuffer() -> Framebuffer +auto lightmap_shader::make_framebuffer(Vector2i size) -> Framebuffer { Framebuffer framebuffer; - framebuffer.fb = GL::Framebuffer{{ {}, image_size }}; + framebuffer.fb = GL::Framebuffer{{ {}, size }}; framebuffer.color = GL::Texture2D{}; - framebuffer.color.setStorage(1, GL::TextureFormat::RGB8, image_size); + framebuffer.color.setStorage(1, GL::TextureFormat::RGB8, size); //framebuffer.depth = GL::Renderbuffer{}; //framebuffer.depth.setStorage(GL::RenderbufferFormat::DepthComponent32F, fb_size); @@ -53,7 +53,8 @@ GL::Mesh lightmap_shader::make_mesh() } lightmap_shader::lightmap_shader() : - framebuffer { make_framebuffer() }, + framebuffer { make_framebuffer(image_size) }, + accum { make_framebuffer(image_size) }, _quads { ValueInit, buffer_size }, _indexes { ValueInit, buffer_size }, _vertex_buf { _quads }, @@ -116,10 +117,8 @@ void lightmap_shader::add_light(Vector2i neighbor_offset, const light_s& light) I = 1; break; case light_falloff::linear: - I = light.dist * tile_size / 5; - break; case light_falloff::quadratic: - I = light.dist * tile_size * 100; + I = light.dist * tile_size; break; } |
