From f42b906596bd2db9b1c0060a7bacfee54843e918 Mon Sep 17 00:00:00 2001 From: xtreme8000 Date: Wed, 22 Nov 2023 10:57:50 +0100 Subject: [PATCH] Limit particle render distance --- source/particle.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/particle.c b/source/particle.c index 8414cca..a02a2fa 100644 --- a/source/particle.c +++ b/source/particle.c @@ -163,6 +163,9 @@ void particle_generate_side(struct block_info* info, enum side s) { static void render_single(struct particle* p, vec3 camera, float delta) { assert(p && camera); + if(glm_vec3_distance2(p->pos, camera) > glm_pow2(32.0F)) + return; + vec3 pos_lerp; glm_vec3_lerp(p->pos_old, p->pos, delta, pos_lerp);