From 6c31ab1ebf9043fa60b30c1e2537f98c8b3e4cdd Mon Sep 17 00:00:00 2001 From: computermouth Date: Wed, 12 Jul 2023 16:40:42 -0600 Subject: [PATCH 1/2] Zero out the light vector for portability --- source/renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/renderer.js b/source/renderer.js index e7c75bf..ebe7e73 100755 --- a/source/renderer.js +++ b/source/renderer.js @@ -116,7 +116,7 @@ R_SOURCE_FS = // 'gl_FragColor=vec4(1.0,1.0,1.0,1.0);' + // Calculate all lights - 'vec3 vl;' + + 'vec3 vl=vec3(0,0,0);' + 'for(int i=0;i<'+R_MAX_LIGHT_V3+';i+=2) {' + 'vl+=' + // Angle to normal From 7928504457446eab852e6edff3239bd40032b75c Mon Sep 17 00:00:00 2001 From: computermouth Date: Wed, 12 Jul 2023 16:41:05 -0600 Subject: [PATCH 2/2] Previously this would share a reference to the position of the entity that spawned it --- source/entity.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/entity.js b/source/entity.js index d1341c7..fc5c088 100755 --- a/source/entity.js +++ b/source/entity.js @@ -192,7 +192,7 @@ class entity_t { _spawn_particles(amount, speed = 1, model, texture, lifetime) { for (let i = 0; i < amount; i++) { - let particle = game_spawn(entity_particle_t, this.p); + let particle = game_spawn(entity_particle_t, vec3_clone(this.p)); particle._model = model; particle._texture = texture; particle._die_at = game_time + lifetime + Math.random() * lifetime * 0.2;