Skip to content

Commit

Permalink
Turn off warnings about generated tangent spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
emackey committed Nov 13, 2024
1 parent 8ed131c commit 791077e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 791077e

Please sign in to comment.