16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 19:09:20 +02:00

motion blur fixes

This commit is contained in:
milek7
2018-12-20 21:23:48 +01:00
parent 45ffc56802
commit 0853cbc29a
3 changed files with 15 additions and 13 deletions

View File

@@ -208,7 +208,7 @@ bool opengl_renderer::Init(GLFWwindow *Window)
m_msaa_fb->attach(*m_msaa_rbv, GL_COLOR_ATTACHMENT1);
m_main_tex = std::make_unique<opengl_texture>();
m_main_tex->alloc_rendertarget(Global.gfx_format_color, GL_RGB, Global.gfx_framebuffer_width, Global.gfx_framebuffer_height);
m_main_tex->alloc_rendertarget(Global.gfx_format_color, GL_RGB, Global.gfx_framebuffer_width, Global.gfx_framebuffer_height, 1, GL_CLAMP_TO_EDGE);
m_main_fb = std::make_unique<gl::framebuffer>();
m_main_fb->attach(*m_main_tex, GL_COLOR_ATTACHMENT0);
@@ -555,9 +555,9 @@ void opengl_renderer::Render_pass(rendermode const Mode)
setup_drawing(true);
glm::mat4 future;
if (!FreeFlyModeFlag)
if (Global.pCamera.m_owner != nullptr)
{
auto const *vehicle = simulation::Train->Dynamic();
auto const *vehicle = Global.pCamera.m_owner;
glm::mat4 mv = OpenGLMatrices.data(GL_MODELVIEW);
future = glm::translate(mv, -glm::vec3(vehicle->get_future_movement())) * glm::inverse(mv);
}