From 791077edebc7da06e49ba4fc6bc21d8dc00a5044 Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Wed, 13 Nov 2024 17:08:23 -0500 Subject: [PATCH] Turn off warnings about generated tangent spaces. --- src/main.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 9cd9f57d..16d2b65f 100644 --- a/src/main.js +++ b/src/main.js @@ -11,6 +11,11 @@ import { import {validateBytes} from "gltf-validator"; +const ignoredIssues = [ + // This sample renderer supports tangent space generation. + "MESH_PRIMITIVE_GENERATED_TANGENT_SPACE" +]; + export default async () => { const canvas = document.getElementById("canvas"); const context = canvas.getContext("webgl2", { @@ -70,7 +75,8 @@ export default async () => { const buffer = await response.arrayBuffer(); return await validateBytes(new Uint8Array(buffer), { externalResourceFunction: externalRefFunction, - uri: model.mainFile + uri: model.mainFile, + ignoredIssues }); } else if (Array.isArray(model.mainFile)) { const externalRefFunction = (uri) => { @@ -98,7 +104,11 @@ export default async () => { const buffer = await model.mainFile[1].arrayBuffer(); return await validateBytes(new Uint8Array(buffer), - {externalResourceFunction: externalRefFunction, uri: model.mainFile[0]}); + { + externalResourceFunction: externalRefFunction, + uri: model.mainFile[0], + ignoredIssues + }); } } catch (error) { console.error(error);