From 422ccd16cd5bb33b1761c24bb8285b718e73e422 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 18:42:07 +0100 Subject: [PATCH] Rain: the cab in the depth prepass also in the rain In the rain the cab is drawn after the precipitation (so the rain inside it is hidden), and it was left out of the depth prepass too, so the opaque pass shaded everything behind it. Its depth now goes into the prepass in any weather (Vulkan 1.4, and OpenGL 4.6 without gfx.depthprepass.replay); the colour of the cab is still drawn after the rain, so nothing changes in the picture. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD --- rendering/opengl46/opengl46renderer.cpp | 5 +++-- rendering/vulkan14/vulkan14frame.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rendering/opengl46/opengl46renderer.cpp b/rendering/opengl46/opengl46renderer.cpp index 6584dde68..e74510f71 100644 --- a/rendering/opengl46/opengl46renderer.cpp +++ b/rendering/opengl46/opengl46renderer.cpp @@ -4294,8 +4294,9 @@ void opengl46_renderer::Render_Scene_Depth( glm::mat4 const &Future, bool const m_scenerecordedparts = static_cast( m_scenechunks.size() ); } else { - // the conditions of the cab drawn early by the colour pass - if( ( false == FreeFlyModeFlag ) && ( Global.Overcast <= 1.0f ) && ( Global.render_cab ) ) { + // the cab first, also in the rain: the colour pass draws it after the rain then (the rain inside it hidden), but with its depth + // here nothing the cab hides is shaded by the opaque pass + if( ( false == FreeFlyModeFlag ) && ( Global.render_cab ) ) { model_ubs.future = m_cabfuture; auto const *vehicle { simulation::Train->Dynamic() }; Render_cab( vehicle, vehicle->InteriorLightLevel, false ); diff --git a/rendering/vulkan14/vulkan14frame.cpp b/rendering/vulkan14/vulkan14frame.cpp index b619e5690..eb7a4567d 100644 --- a/rendering/vulkan14/vulkan14frame.cpp +++ b/rendering/vulkan14/vulkan14frame.cpp @@ -1893,8 +1893,9 @@ void vulkan14_renderer::render_scene_depth(std::size_t const Index, glm::mat4 co auto const colourstats{m_renderpass.draw_stats}; m_renderpass.draw_stats = {}; walk_blending(false); - // the conditions of the cab drawn early by the colour pass - if ((false == FreeFlyModeFlag) && (Global.Overcast <= 1.0f) && Global.render_cab && simulation::Train) + // the cab first, also in the rain: the colour pass draws it after the rain then (the rain inside it hidden), but with its depth here + // nothing the cab hides is shaded by the opaque pass (in a station seen from the cab: about a third of the time of the opaque pass) + if ((false == FreeFlyModeFlag) && Global.render_cab && simulation::Train) { model_ubs.future = m_cabfuture; auto const *vehicle{simulation::Train->Dynamic()};