diff --git a/precipitation.cpp b/precipitation.cpp index 2fab0d17..00fb7180 100644 --- a/precipitation.cpp +++ b/precipitation.cpp @@ -111,7 +111,7 @@ basic_precipitation::init() { void basic_precipitation::update() { - auto const timedelta { static_cast( ( DebugModeFlag ? Timer::GetDeltaTime() : Timer::GetDeltaTime() ) ) }; + auto const timedelta = Timer::GetDeltaTime(); if( timedelta == 0.0 ) { return; } diff --git a/renderer.cpp b/renderer.cpp index 446f5263..7b480c9f 100644 --- a/renderer.cpp +++ b/renderer.cpp @@ -2797,12 +2797,17 @@ void opengl_renderer::Render_precipitation() ::glRotated(roll, forward.x, 0.0, forward.z); } } - if (Global.Weather == "rain:") + if (!Global.iPause) { - // oddly enough random streaks produce more natural looking rain than ones the eye can follow - ::glRotated(Random() * 360, 0.0, 1.0, 0.0); + if (Global.Weather == "rain:") + // oddly enough random streaks produce more natural looking rain than ones the eye can follow + m_precipitationrotation = Random() * 360; + else + m_precipitationrotation = 0.0; } + ::glRotated(m_precipitationrotation, 0.0, 1.0, 0.0); + model_ubs.set_modelview(OpenGLMatrices.data(GL_MODELVIEW)); model_ubs.param[0] = interpolate(0.5f * (Global.DayLight.diffuse + Global.DayLight.ambient), colors::white, 0.5f * clamp(Global.fLuminance, 0.f, 1.f)); model_ubs.param[1].x = simulation::Environment.m_precipitation.get_textureoffset(); diff --git a/renderer.h b/renderer.h index 2e7d9aa7..3a583691 100644 --- a/renderer.h +++ b/renderer.h @@ -330,6 +330,8 @@ class opengl_renderer GLuint m_gltimequery = 0; GLuint64 m_gllasttime = 0; + double m_precipitationrotation; + glm::mat4 perspective_projection(float fov, float aspect, float z_near, float z_far); glm::mat4 perpsective_frustumtest_projection(float fov, float aspect, float z_near, float z_far); glm::mat4 ortho_projection(float left, float right, float bottom, float top, float z_near, float z_far);