From c207970e87b516459c56b437d55f9148c38a26e7 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Wed, 10 Jun 2026 21:41:43 +0100 Subject: [PATCH] Don't recreate --- .../program/uniform-array-autoscaling-program.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/graphics/graphics-library/program/uniform-array-autoscaling-program.ts b/src/graphics/graphics-library/program/uniform-array-autoscaling-program.ts index e0bc264..80c9d1a 100644 --- a/src/graphics/graphics-library/program/uniform-array-autoscaling-program.ts +++ b/src/graphics/graphics-library/program/uniform-array-autoscaling-program.ts @@ -9,6 +9,11 @@ import { IProgram } from './i-program'; /** @internal */ export class UniformArrayAutoScalingProgram implements IProgram { + private static readonly farAwayTransform = mat2d.fromTranslation( + mat2d.create(), + vec2.fromValues(-10000, -10000) + ); + private programs: Array<{ program: FragmentShaderOnlyProgram; values: Array; @@ -94,7 +99,7 @@ export class UniformArrayAutoScalingProgram implements IProgram { for (let i = 0; i < difference; i++) { d.empty.serializeToUniforms( uniforms, - mat2d.fromTranslation(mat2d.create(), vec2.fromValues(-10000, -10000)), + UniformArrayAutoScalingProgram.farAwayTransform, 0 ); }