From f76bceef1b46e254537abde274c77fd969d657fe Mon Sep 17 00:00:00 2001 From: Testtesttestestes <118276433+Testtesttestestes@users.noreply.github.com> Date: Tue, 10 Mar 2026 14:51:31 +0400 Subject: [PATCH] Fix side-wall particle climbing in SPH collision response --- src/sph/update.frag | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sph/update.frag b/src/sph/update.frag index d730aab..0fd0fde 100644 --- a/src/sph/update.frag +++ b/src/sph/update.frag @@ -269,7 +269,8 @@ void main(void) { // Shared tangential drift from flask motion makes the whole contact layer move together. vec2 wallTangent = vec2(-wallNormal.y, wallNormal.x); float wallSlip = dot(wallVel, wallTangent); - float cohesiveSlip = wallSlip * nearWallBlend * u_wave_amplitude * 0.35; + float sideWallFactor = smoothstep(0.55, 0.9, abs(normalLocal.x)); + float cohesiveSlip = wallSlip * nearWallBlend * u_wave_amplitude * 0.35 * (1.0 - sideWallFactor); velh = wallVel + relVN * wallNormal + relVT + cohesiveSlip * wallTangent; }