Deferred example tweaking

This commit is contained in:
Nikita Lisitsa 2020-10-25 20:34:56 +03:00
parent 2e0da621d1
commit 11e9abf414

View file

@ -296,7 +296,7 @@ void deferred_app::on_resize(int width, int height)
app::on_resize(width, height);
camera.set_fov(camera.fov_y, static_cast<float>(width) / height);
pre_gamma_texture.load<gfx::color_rgb>({width, height});
pre_gamma_texture.load<geom::vector<std::uint16_t, 3>>({width, height});
pre_gamma_framebuffer.color(pre_gamma_texture);
pre_gamma_framebuffer.assert_complete();
@ -404,8 +404,8 @@ void deferred_app::render()
auto & l = options.point_lights.emplace_back();
l.color = {15.f, 15.f, 15.f};
l.position = {std::cos(a) * 10.f, std::sin(a) * 10.f, 0.5f};
l.attenuation = {1.f, 0.5f, 1.f};
l.position = {std::cos(a) * 9.f, std::sin(a) * 9.f, 0.5f};
l.attenuation = {0.f, 0.f, 10.f};
}
for (auto const & l : options.point_lights)
@ -424,6 +424,7 @@ void deferred_app::render()
float const gamma = 2.2f;
options.max_intensity = 20.f;
options.min_intensity = options.max_intensity / std::pow(8.f, gamma);
gfx::framebuffer::null().bind();
gl::DrawBuffer(gl::BACK);