6215add877
Change-Id: I2fe6e6a634a406f4c0e5c491b4ff6286ae888175
Reviewed-on: https://chromium-review.googlesource.com/c/external/github.com/WebKit/JetStream/+/7124399
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
25 lines
898 B
JavaScript
25 lines
898 B
JavaScript
import { runComplexScene } from "../src/babylon-js-benchmark.mjs";
|
|
import { promises as fs } from "fs";
|
|
import path from "path";
|
|
import { fileURLToPath } from "url";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
const fortPath = path.resolve(__dirname, "../data/pirateFort.glb");
|
|
const cannonPath = path.resolve(__dirname, "../data/cannon.glb");
|
|
const particlePath = path.resolve(__dirname, "../data/particles.json");
|
|
|
|
async function main() {
|
|
try {
|
|
const fortBuffer = await fs.readFile(fortPath);
|
|
const cannonBuffer = await fs.readFile(cannonPath);
|
|
const particleData = JSON.parse(await fs.readFile(particlePath, "utf-8"))
|
|
const {classNames, cameraRotationLength} = await runComplexScene(fortBuffer, cannonBuffer, particleData, 1000);
|
|
} catch(e) {
|
|
console.error(e);
|
|
console.error(e.stack);
|
|
}
|
|
}
|
|
|
|
main();
|