18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 13:06:46 +01:00

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
This commit is contained in:
lcddisplay
2026-11-08 22:23:17 +01:00
committed by Claude
parent 77e4abadae
commit d8f0c46c7f
+3 -1
View File
@@ -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;
}