From 933ae7a5a1b89d37f4a33eb5a28a6e2000953e58 Mon Sep 17 00:00:00 2001 From: lcddisplay Date: Sun, 8 Nov 2026 22:23:17 +0100 Subject: [PATCH] Sun shadows of the gpu culling: the replayed walks keep the parameters of the materials A walk kept from an earlier frame (gfx.gpucull.walkcache) gave the draws of the shadows the parameters the pass had at the moment, not those of their materials. mat_vat.vert reads vat_speed from them in the shadow too, so the shadows of the animals and people animated by textures stood still on Vulkan with gfx.gpucull.shadows. The common shadow programs read none of them. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2 --- rendering/common/scenewalkindirect.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rendering/common/scenewalkindirect.cpp b/rendering/common/scenewalkindirect.cpp index c526fabce..1406e1815 100644 --- a/rendering/common/scenewalkindirect.cpp +++ b/rendering/common/scenewalkindirect.cpp @@ -865,9 +865,11 @@ void scene_walk::Replay_Walk(walk_band const &Walk, bool const Shadows) draw.ubs = model_ubs; draw.ubs.modelview = walked.modelview; draw.ubs.modelviewnormal = walked.modelviewnormal; + // the parameters of the material go with the shadows too: a material which moves its vertices in a vertex shader of its own + // reads them there (vat_speed of mat_vat.vert, without which its shadow stands still); the common shadow programs don't + std::memcpy(&draw.ubs.param[0], &walked.param[0], sizeof(draw.ubs.param)); if (false == Shadows) { - std::memcpy(&draw.ubs.param[0], &walked.param[0], sizeof(draw.ubs.param)); draw.ubs.opacity = walked.opacity; draw.ubs.alpha_mult = walked.alpha_mult; }