From fc1a9f3c619d7eb2ec4abd4b042dea1cd1f0108f Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 16 Feb 2022 11:06:21 -0500 Subject: [PATCH] Trail thinning is now smooth --- voxygen/src/scene/trail.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/voxygen/src/scene/trail.rs b/voxygen/src/scene/trail.rs index 57c9305a6a..91fb7abb46 100644 --- a/voxygen/src/scene/trail.rs +++ b/voxygen/src/scene/trail.rs @@ -47,8 +47,11 @@ impl TrailMgr { // Verts per quad are in b, c, a, d order vertices[i * 4 + 2] = vertices[i * 4 + 2] * TRAIL_SHRINKAGE + vertices[i * 4] * (1.0 - TRAIL_SHRINKAGE); - vertices[i * 4 + 3] = vertices[i * 4 + 3] * TRAIL_SHRINKAGE - + vertices[i * 4 + 1] * (1.0 - TRAIL_SHRINKAGE); + if i != (self.offset + TRAIL_DYNAMIC_MODEL_SIZE - 1) % TRAIL_DYNAMIC_MODEL_SIZE { + // Avoid shrinking edge of most recent quad so that edges of quads align + vertices[i * 4 + 3] = vertices[i * 4 + 3] * TRAIL_SHRINKAGE + + vertices[i * 4 + 1] * (1.0 - TRAIL_SHRINKAGE); + } } // Reset quad for each entity mesh at new offset