From d8f0c46c7f321e676c0ecdbe1fad194699666a4b 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 e65606827..4953e3c8d 100644 --- a/rendering/common/scenewalkindirect.cpp +++ b/rendering/common/scenewalkindirect.cpp @@ -866,9 +866,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; }