18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 10:37:07 +01:00

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
This commit is contained in:
Claude
2026-11-03 18:42:07 +01:00
parent a7fc8541c8
commit 422ccd16cd
2 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -4294,8 +4294,9 @@ void opengl46_renderer::Render_Scene_Depth( glm::mat4 const &Future, bool const
m_scenerecordedparts = static_cast<std::uint32_t>( 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 );
+3 -2
View File
@@ -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()};