Skip to content

Commit

Permalink
added a (failing) test.. investigating
Browse files Browse the repository at this point in the history
  • Loading branch information
MatsErdkamp committed May 26, 2024
1 parent e61823a commit 9929b1b
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 39 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added serve/assets/vase/.DS_Store
Binary file not shown.
Binary file added test/.DS_Store
Binary file not shown.
Binary file added test/assets/.DS_Store
Binary file not shown.
Binary file added test/assets/teapot/teapot-binary-meshopt.glb
Binary file not shown.
93 changes: 54 additions & 39 deletions test/gltf.test.mjs
Original file line number Diff line number Diff line change
@@ -1,52 +1,67 @@
import { expect } from "chai"
import { expect } from "chai";

describe("glTF", () => {

it("should render separate correctly using pixi *.*.*", async () => {
let render = (renderer, resources) => {
let model = PIXI3D.Model.from(resources["assets/teapot/teapot-separate.gltf"].gltf)
model.y = -0.8
model.meshes.forEach(mesh => {
mesh.material.unlit = true
})
renderer.render(model)
}
let model = PIXI3D.Model.from(
resources["assets/teapot/teapot-separate.gltf"].gltf
);
model.y = -0.8;
model.meshes.forEach((mesh) => {
mesh.material.unlit = true;
});
renderer.render(model);
};
await expect(render).to.match("snapshots/wdhdo.png", {
resources: [
"assets/teapot/teapot-separate.gltf"
]
})
})
resources: ["assets/teapot/teapot-separate.gltf"],
});
});

it("should render binary correctly using pixi *.*.*", async () => {
let render = async (renderer, resources) => {
let model = PIXI3D.Model.from(resources["assets/teapot/teapot-binary.glb"].gltf)
model.y = -0.8
model.meshes.forEach(mesh => {
mesh.material.unlit = true
})
renderer.render(model)
}
let model = PIXI3D.Model.from(
resources["assets/teapot/teapot-binary.glb"].gltf
);
model.y = -0.8;
model.meshes.forEach((mesh) => {
mesh.material.unlit = true;
});
renderer.render(model);
};
await expect(render).to.match("snapshots/wdhdo.png", {
resources: [
"assets/teapot/teapot-binary.glb"
]
})
})
resources: ["assets/teapot/teapot-binary.glb"],
});
});

it("should render embedded correctly using pixi *.*.*", async () => {
let render = (renderer, resources) => {
let model = PIXI3D.Model.from(resources["assets/teapot/teapot-embedded.gltf"].gltf)
model.y = -0.8
model.meshes.forEach(mesh => {
mesh.material.unlit = true
})
renderer.render(model)
}
let model = PIXI3D.Model.from(
resources["assets/teapot/teapot-embedded.gltf"].gltf
);
model.y = -0.8;
model.meshes.forEach((mesh) => {
mesh.material.unlit = true;
});
renderer.render(model);
};
await expect(render).to.match("snapshots/wdhdo.png", {
resources: ["assets/teapot/teapot-embedded.gltf"],
});
});

it("should render meshopt correctly using pixi *.*.*", async () => {
let render = (renderer, resources) => {
let model = PIXI3D.Model.from(
resources["assets/teapot/teapot-binary-meshopt.glb"].gltf
);
model.y = -0.8;
model.meshes.forEach((mesh) => {
mesh.material.unlit = true;
});
renderer.render(model);
};
await expect(render).to.match("snapshots/wdhdo.png", {
resources: [
"assets/teapot/teapot-embedded.gltf"
]
})
})
})
resources: ["assets/teapot/teapot-binary-meshopt.glb"],
});
});
});

0 comments on commit 9929b1b

Please sign in to comment.