From 3238427488c53a22c4f888cf9e72e8782dc3f3cf Mon Sep 17 00:00:00 2001 From: AlexandruPopovici Date: Sun, 7 May 2023 17:14:43 +0300 Subject: [PATCH] Due to a small overlook, mesh batches had color VBOs created always, regardless if there were colors or not. With this fixed, we're reduced memory footprint taken up pointlessly --- packages/viewer/src/modules/converter/GeometryConverter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/viewer/src/modules/converter/GeometryConverter.ts b/packages/viewer/src/modules/converter/GeometryConverter.ts index d255ca812..97496c21c 100644 --- a/packages/viewer/src/modules/converter/GeometryConverter.ts +++ b/packages/viewer/src/modules/converter/GeometryConverter.ts @@ -281,7 +281,7 @@ export class GeometryConverter { const vertices = node.raw.vertices const faces = node.raw.faces const colorsRaw = node.raw.colors - let colors = null + let colors = undefined let k = 0 while (k < faces.length) { @@ -321,7 +321,7 @@ export class GeometryConverter { attributes: { POSITION: vertices, INDEX: indices, - COLOR: colors + ...(colors && { COLOR: colors }) }, bakeTransform: new Matrix4().makeScale( conversionFactor,