Files
matrix/js/main.js
Rezmason 2364bbc8bc rainPass now renders multiple cameras and viewports, using data from the hardware.
Added quiltPass (which uses holoplay’s quilting shader).
Added a holoplay effect version. (Versions can also now specify a preferred renderer.)
2021-12-19 12:08:31 -08:00

20 lines
679 B
JavaScript

import makeConfig from "./config.js";
const canvas = document.createElement("canvas");
document.body.appendChild(canvas);
document.addEventListener("touchmove", (e) => e.preventDefault(), {
passive: false,
});
const supportsWebGPU = async () => {
return window.GPUQueue != null;
};
document.body.onload = async () => {
const urlParams = Object.fromEntries(new URLSearchParams(window.location.search).entries());
const config = makeConfig(urlParams);
const useREGL = !(await supportsWebGPU()) || ["webgl", "regl"].includes(config.renderer?.toLowerCase());
const solution = import(`./${useREGL ? "regl" : "webgpu"}/main.js`);
(await solution).default(canvas, config);
};