From caaaf606d399316b1ed96ab4e7057ae398d4b7d2 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Fri, 21 Jul 2023 18:35:34 +0200 Subject: [PATCH] Update compute_particles.nzsl --- assets/shaders/compute/compute_particles.nzsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/shaders/compute/compute_particles.nzsl b/assets/shaders/compute/compute_particles.nzsl index cce7f2009..be9ddfd70 100644 --- a/assets/shaders/compute/compute_particles.nzsl +++ b/assets/shaders/compute/compute_particles.nzsl @@ -51,7 +51,7 @@ fn main(input: Input) // But want to return to their original position let dist = length(data.particles[index].targetPosition - data.particles[index].position); - let shouldUseDir = dist < 1.0; + let shouldUseDir = dist > 1.0; data.particles[index].velocity += 100.0 * sceneData.deltaTime * select(shouldUseDir, normalize(data.particles[index].targetPosition - data.particles[index].position), vec2[f32](0.0, 0.0)); // Lose speed with time